simiouser1 Posted July 12, 2016 Share Posted July 12, 2016 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. Link to comment Share on other sites More sharing options...
ptkolodziejczyk Posted July 12, 2016 Share Posted July 12, 2016 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 More sharing options...
simiouser1 Posted July 12, 2016 Author Share Posted July 12, 2016 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 Link to comment Share on other sites More sharing options...
ptkolodziejczyk Posted July 12, 2016 Share Posted July 12, 2016 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 More sharing options...
simiouser1 Posted July 13, 2016 Author Share Posted July 13, 2016 Thank you so much, ptkolodziejczyk. I've done with your help. Thank you so much. Link to comment Share on other sites More sharing options...
Recommended Posts