ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 06-28-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default Creating groups and analyzing the model with new states

Dear all,

I've created a new model, and to analyze it I created a new "states" (example: "waiting_to_load", "waiting_to_unload", "time in 'x' area") but I can't analyze this states in FlexSim Chart, only in object dynamically graph. I tried to do this through "User Define Attributes" in "Reports and Statistics", but I could not do, I don't know why. If this is possible, someone could help me please??

Taking the opportunity, I would like to know if there are any way to create groups, for example, group of persons, group of trucks, etc...to after that analyze this groups as one??

Thanks,

Last edited by Flavio Brito; 06-28-2010 at 10:49 AM.
  #2  
Old 06-28-2010
AJ Bobo's Avatar
AJ Bobo AJ Bobo is offline
Flexsim Senior Developer
 
Join Date: Jul 2007
Posts: 108
Downloads: 8
Uploads: 0
Thanks: 23
Thanked 89 Times in 41 Posts
Rep Power: 221
AJ Bobo is a jewel in the roughAJ Bobo is a jewel in the roughAJ Bobo is a jewel in the roughAJ Bobo is a jewel in the rough
Default

Flavio,

Flexsim Chart is only capable of reporting on the standard Flexsim states. We would like to improve the reporting capabilities, and custom states is one of the features that has been requested.

You can create create groups of objects for reporting purposes by selecting the objects that you would like in a group and using the Groups tool window. This window is opened by selecting View|Modeling Utilities|Groups from the main menu.

A.J.
The Following 2 Users Say Thank You to AJ Bobo For This Useful Post:
Stefan Trabut (04-18-2011)
  #3  
Old 06-29-2010
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Flavio,

It is possible to use userdefined statistics in your model. You have to add your states to the state profile of your object, as numeric nodes. You can find the state profile node at >stats/state/state_profile on your object. Objects have a default of 50 states, so your state numbers will start at 51. Then you can use the setstate( Object, 51 ), to change the state of your object to the first user defined state. These states will show in your Flesxim chart.
Note that this doesn't work for flowitems, because their states are set automatically. But if you want to change a default flexsim state to a user defined state see thread: http://www.flexsim.com/community/for...ead.php?t=1099. This works for flowitems as well. I am not sure that the OnStateChange trigger has been added in version 5 for the basic FR and TE objects.

Esther
The Following User Says Thank You to Esther Bennett For This Useful Post:
Flavio Brito (06-29-2010)
  #4  
Old 06-29-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Dear Esther,

Thanks for your help. Ok, I've made this, and states was showed in dynamic chart into the object, but I would like to see this variables in FlexSimChart, which unfortunatly, according with AJ, are not possible yet. In this case, I will try to analyze this by "Perform Measures" in Experimenter, but for that, I need to use a label, and I don't know how input the reference by the new state in tree to get the time that the object was in "x" state. The follow coding is my logic to set the labelnum:

double timestateload = getvarnum(current, "????");

setlabelnum(current,"Time waiting to load", timestateload);


Where the "????" represent the tree structure to arrive in state 51("waiting_to_load"), created for me.

Thanks in advance
  #5  
Old 06-30-2010
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Use the following code to arrive at state 51


treenode State51 = rank( state_profile( current ), 51 );

( state_profile is an attribute (a direct pointer to a node in the tree), usually recognizable because the name is blue)

and to get the nr of seconds:

double StateTime = getnodenum( State51 );

Last edited by Steven Hamoen; 06-30-2010 at 03:06 AM.
The Following 4 Users Say Thank You to Steven Hamoen For This Useful Post:
Nico Zahn (06-30-2010)
  #6  
Old 06-30-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default Another problem

Hi Steven, thanks,

Now I'm facing another problem:

Originally, when TE stop behind another, the assumed state is BLOCKED, but in this case, I could not identify when the queue is in Queue2 or when is in Queue3, that's why, I made a logic that when TE is loaded, the trucks in Queue3 assumed state "waiting_to_unload" and when they are in Queue2 the assumed state is "waiting_to_load".

When the "Run Speed" is slow this work perfectly, but if I accelerate that, the BLOCKED state appear in chart in a big percentage. I've made some tests, and I figured out that this state is assumed seconds before the logic to change the state to be executed. Probably the programming have not be executed when the simulation is very fast, I don't know the reason of that, if the logic is heavy (I don't belive that) or if there is a technical problem. In attached file, I saved three states:

- First (Run speed_50):
Run simulation = 50000 seconds
Run Speed = 50
Percentage state BLOCKED = about 0.5%

-Second (Run speed_1000):
Run simulation = 50000 seconds
Run speed = 1000
Percentage state BLOCKED = 11.4%

- Third (Run speed_100000):
Run simulation = 50000
Run speed = 100000
Percentage state BLOCKED = 43.8%

Note that, wich faster the simulation time lower the state waiting_to_load", ie lower the implementation of programming.

Why??

Thanks,
Attached Files
File Type: zip New_States.zip (132.4 KB, 169 views)
  #7  
Old 07-02-2010
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Flavio,

You will have to use the OnStateChange trigger (in the eventfunctions of a TE) to change the state. Furthermore you have to use the eventcode to determine the state of an object. In stead of comparing the state of the object to STATE_BLOCKED, you have to compare the eventcode to STATE_BLOCKED and depending on the status return the newstate you want the TE to have.
This all may sound a little cryptic, so I have changed your model (TE11) with the correct way to change the state.

Esther
Attached Files
File Type: zip problem with new states_EB.zip (28.3 KB, 171 views)
The Following 5 Users Say Thank You to Esther Bennett For This Useful Post:
Tom David (07-02-2010)
  #8  
Old 07-05-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Dear Esther,

First of all thanks again.

I did not know this trigger function. There is any material for me understand this better?? I did not find anything in forum, only some examples, this helped me a little, but I did not understand perfectly, principally about the new node "Flexscript byte code", from where this come from? Is programmed manually or already there any template?

About the model above, the logic is right, but when the model is running, the graph is wrong because the bottleneck is in Queue2 (State = "waiting_to_load"), and graph indicates "waiting_to_unload". I've tryed change the logic, change the assigned method, change the state, make everything again, but unsuccessfully. I only realized that independent of item there or not, the state assumed was always the first quoted in programming(in this case, state 52 = "waiting_to_unload)". What is wrong?

Last edited by Flavio Brito; 07-05-2010 at 12:05 PM.
  #9  
Old 07-05-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

When you build a Flexscript node (right click menu in the tree) it generates the byte code and node for you. You don't need to consider it at all.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Flavio Brito (07-05-2010)
  #10  
Old 07-05-2010
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Flavio,

Try to change the code
Code:
treenode current=ownerobject(c); 
to 
treenode current=c;
in the OnStateChange trigger.

Lars-Olof
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
Flavio Brito (07-05-2010)
  #11  
Old 07-05-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Hi Lars-Olof,

Perfect, problem solved. But why this happen?? Do you know???
  #12  
Old 07-05-2010
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi,

The c references to the object that calls OnStateChange in your case the object that OnStateChange belongs to.

ownerobject
is used to get the node/object that c belongs to in your model that would be the model.

When using ownerobject(c) you get a reference to the model and not the object you want check the state change on. Because of this you will always get a references to a node that exist when executing first(current), the Tools node.

If I missed something, hopefully someone else can fill in the missing parts.

Lars-Olof
The Following 7 Users Say Thank You to Lars-Olof Leven For This Useful Post:
Tom David (07-05-2010)


Thread Thread Starter Forum Replies Last Post
Creating a stacked bar chart for the states of multiple objects Kris Geisberger Tips and Tricks 6 08-11-2011 09:40 PM
Creating new variables to analize the model Flavio Brito Q&A 1 06-02-2010 03:16 PM
Scheduled_down and Waiting_for_operator states Markus Bans Q&A 1 05-05-2009 11:48 AM
Social Groups??? Brandon Peterson Q&A 0 11-14-2008 01:16 PM
Flow items with states AlanZhang Q&A 16 11-30-2007 10:32 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.