Jump to content

Time TransferNode is occupied


simiouser1
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
Share on other sites

×
×
  • Create New...