austinrehmar Posted May 3, 2017 Share Posted May 3, 2017 I would like to record the total distance traveled in free space for 70+ of the same entity, going to random sinks from many different sources. I have tried using the "totaldistancetraveled" function, but can only get it to work for a specific entity (for example "ModelEntity[1].TotalDistanceTraveled"). What is the best way to do this. Link to comment Share on other sites More sharing options...
CWatson Posted May 3, 2017 Share Posted May 3, 2017 To get the total distance of a number of entities over time, you could add a model state variable (Definitions/States), let's call it 'TotalDistance', and assign its value every time an entity leaves the system (Sink) in the State Assignments section. Thus, the State Variable Name 'TotalDistance' would be set to the New Value 'TotalDistance + ModelEntity.TotalDistanceTraveled'. Then, within the Definitions/Elements, you could have an Output Statistic element that evaluated and reported the value of the Expression 'TotalDistance' so that it is reported in the Reports / Pivot Grid for the model. Link to comment Share on other sites More sharing options...
Recommended Posts