1
votes

Dear Anylogic Experts,

I am trying to calculate the cost based on distance travelled by the agents in GIS environment. Does anyone know how can I calculate this? The final graph function is supposed to look like this: Distance moved by Agent in km or meter multiplied by the Cost per km or meter.

The idea is to see which route will cost how much. The way I have moved agents in via PML. please see picture attached of the process taking place. PLease see picture link here

1

1 Answers

1
votes

there is no default way for this, several options:

  1. Turn on "Model execution logging" and you will get total travelled distance for each agent.
  2. In your MoveTo blocks, log the departure and arrival location (lat/lon) of your agent and use getDistanceGIS(...) to log the total distance from your agent