Jump to content
Sign in to follow this  
simiouser1

Time TransferNode is occupied

Recommended Posts

Maybe it's something trivial, but I want to know, a much time a transfernode is occupied by an entity, I've modeled a simple model, where the entities, wait in a transfer node until a station turns free.

Share this post


Link to post
Share on other sites

To know the exact times for individual entities you need to define state variables within you entity and compare the time between OnEntered and OnExited events.


If you want to know general statistics of all you entities you should use a Tally Statistics. Then you also measure waiting time OnExited as:

TimeNow - ModelEntity.TimeEnteredNode

Share this post


Link to post
Share on other sites

No, I just only want to know the complete time of a transfernode has been occupied.


I've been trying but I don't know how to see the time. If you could give me another clue I would appreciate it

Share this post


Link to post
Share on other sites

You can create a list state with 2 values: occupied or empty. Then every time an entity enters you set to occupied and when it leaves you check if it is the last entity and if so then set it to empty. The rest is taken for you and you can access percentage or total times easily.


Otherwise, you need to have 3 global variables, call them Sum, Aux (both Real) and and Occupied (Boolean) to keep track if occupied.

Then:

OnEntered: If not Occupied then Aux = TimeNow, Occupied = True.

OnExited: If Node.NumberTravelers == 0, then Sum = Sum + Aux - TimeNow, Occupied = False.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×