ATTENTIONThis 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 |
|
Downloads |
Tips and Tricks Share helpful modeling ideas |
#1
|
|||
|
|||
Make sure you stop model with the stop button before collecting state based statistics
For those who are unaware (like myself until today) the state based statistics will not take into account the most recent time spent in a given state (eg idle time after an operation has finished) unless the updatestates() command is called. This is called when you push the stop button, but NOT when you just slow the model time down to 0.
Regards Paul |
#2
|
||||
|
||||
Paul,
The update states command is also not called when you hit the pause button. The reason for this is that it can take some time for a model to update states if the model is very large and we wanted to give the users a way to pause the model without having to incure the delay. This is the reason that slowing the model speed to zero and hitting pause do not update states.
__________________
thats not normal. |
The Following User Says Thank You to Brandon Peterson For This Useful Post: | ||
Scott Mackay (10-07-2009) |
#3
|
|||
|
|||
Since updatestates() acts on all objects in the model, you may want to be more selective on where and how frequently you use it. Use updatestate() if you are interested in a single object or a select few.
The long way (for further understanding of the state tree) The updated total idle time of a single object can be obtained with the code below without using updatestate(). I am assuming in this example that "operator" is a pointer to the object we are interested in. Note that in the state tree, the state_since node is a time stamp when the object changed into its current state (when the state profile was last updated). double totalidletime = getnodenum(rank(state_profile(operator), STATE_IDLE)); if(getstatenum(operator)==STATE_IDLE) totalidletime += time() - getnodenum(state_since(operator)); |
The Following 3 Users Say Thank You to Kris Geisberger For This Useful Post: | ||
Scott Mackay (10-07-2009) |
Thread | Thread Starter | Forum | Replies | Last Post |
In what cases the running simulation would stop itself? | KelvinHo | Q&A | 1 | 05-08-2008 08:32 AM |
How to run tasks after stop time? | Fadhlullah Bin Rahmat | Q&A | 1 | 02-26-2008 04:44 PM |
State Graph in Model Control GUI | Tom David | Q&A | 4 | 11-21-2007 12:50 AM |
Stop conveyor on loading | mathiasds | Q&A | 2 | 11-20-2007 04:31 PM |
Stop message with information (Debugging) | Tom David | Tips and Tricks | 0 | 09-20-2007 01:10 AM |