Is there any way to speed up the simulation?

Requests regarding how to set up experiments in ARGoS.
Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

Is there any way to speed up the simulation?

Postby Ryan » Fri Feb 21, 2020 7:28 am

Hey,

I want to play my experiment 100 times and gather results. And 10000 steps per experiment. In my experiment, I used more than 40 robots to finish it. It takes me at least six hours to get the results of a hundred experiments. I have closed the visualization to speed up the simulation. But it still needs a lot of time. So, Is there any way to speed up the simulation?

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: Is there any way to speed up the simulation?

Postby pincy » Fri Feb 21, 2020 5:55 pm

There are many ways to do that. First, make sure that you are using a version of ARGoS that has been compiled with optimizations on (the default binary packages are optimized). Next, make sure that your code is as fast as possible (compiled with optimizations, functions don't return vectors/structs unnecessarily, you use proper data structures in your code, you have no memory leaks, etc).

Next, ARGoS can be configured to exploit better the resources of your computer. You can:
  • Use multiple threads (set it in the .argos file)
  • Partition the environment so that multiple physics engines can simulate a portion of it (see argos3 -q dynamics2d)
  • Configure better cell sizes for the LED and RAB media grids - this depends on size and density of the robots in your experiment (see argos3 -q media)
  • Switch off sensors/actuators you don't use, switch off ray recording when not using a visualization
... plus more tricks that are experiment-specific and depend on your code.
I made ARGoS.

Ryan
Posts: 42
Joined: Wed Oct 23, 2019 3:26 am

Re: Is there any way to speed up the simulation?

Postby Ryan » Sat Feb 22, 2020 6:54 am

Thanks for your help!


Return to “How to... ?”