Jump to content

Recommended Posts

Posted

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.

Posted

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.

×
×
  • Create New...