1

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 Answers1

1

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
Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Hmmm. Seems like the fear was right. Since my distance vary on the network, I believe way 1 will be the only way :) Thank you Mr. Benjamin, appreciate your help. – Jahanzeb Ahsan Jun 21 '20 at 13:51
  • no probs, @JahanzebAhsan. Please flag the reply as "useful" (small up-arrow next to it) so others can find the solution faster in the future. Good practice on StackOverflow :) – Benjamin Jun 22 '20 at 11:35