W L
W L

Reputation: 31

How to make Anylogic simulations run faster?

I have a model with agents: cars, passengers and petrol stations. The population size of the cars is 500 and there are 5 petrol stations. The passengers here are generated randomly and I have capped the passengers on the map to be at a maximum of 500 at any point in time (the limit here is set to be the same as the population size of the cars).

However, the simulation speed is running really slow (like 1-2s/sec) on virtual mode. Could this be due to the complicated model built or are there any ways on how we can speed up the running time of the simulation?

Upvotes: 3

Views: 1797

Answers (1)

Benjamin
Benjamin

Reputation: 12793

Many factors can slow your model, here are just some ideas:

  • Do you use Pedestrian agent types for your passengers? Try not to, unless ped dynamics are crucial
  • do you use conditional transitions? They are evualated at every event in the model and can slow it. You can always replace them with message-based transitions easily
  • Do you use the road traffic library? Again, only apply it if car dynamics are really necessary, else revert to the process library
  • Do you read/write a lot of data during the sim run to the dbase or an external file? Avoid that and do it at the start/end

Also, it could just be inefficient coding. You can check that using a Java profiler. Easiest is to use the one that comes with any Java JDK.

Good luck

Upvotes: 5

Related Questions