Running a 1000-Robot Simulation

Requests regarding how to set up experiments in ARGoS.
M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Running a 1000-Robot Simulation

Postby M_Rizk » Tue Oct 13, 2015 12:16 pm

I read in the paper that is linked to on the home page that ARGoS has been tested with swarms of as many as 10,000 robots. I am interested in running a simulation with 1000 foot-bots (or more if possible) but even as few as 50 robots causes the simulator to lag. Is there a way to configure ARGoS's settings somehow that could enable me to simulate a larger swarm? For example, is there an option to render the bots in a graphically simpler form (e.g. as points in space)? Are there perhaps any features that are enabled by default which may not be relevant to me that I could disable? Or do I just need to run my code on a more powerful machine?

My specs are as follows:
Memory- 8GB
Processor- Intel Core i7-2630QM. Quad core 2GHz
OS: Ubuntu 14.04 LTS (64-bit)

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

Re: Running a 1000-Robot Simulation

Postby pincy » Wed Oct 14, 2015 12:05 am

I read in the paper that is linked to on the home page that ARGoS has been tested with swarms of as many as 10,000 robots.
Yes, this is correct.
I am interested in running a simulation with 1000 foot-bots (or more if possible) but even as few as 50 robots causes the simulator to lag. Is there a way to configure ARGoS's settings somehow that could enable me to simulate a larger swarm?
Yes, you need to configure ARGoS well.
  1. You need to use many threads. How many depends on your architecture. Experiment with the value a little bit. There are two ways to schedule threads. The default scheduler works well when the robots are identical and execute identical controllers. There is another scheduler that works best when the robots are different and/or run controllers with different computational costs.
  2. To improve parallelism, you need to use multiple physics engines, like it's done in the paper. The more you use, the faster ARGoS is. How to divide the arena into multiple physics engines depends on the structure of your arena. The sizes of the physics engines do not need to be identical.
  3. Another thing that improves performance is optimizing the size of the grids used to check ray intersections and simulate communication. The ideal size is usually given by the size of the bounding box of the most common object in the simulation.
  4. The visualization is the only problem, because it cannot be parallelized. In my simulations I either avoid using it when I do data collection (like it's done in the paper), or I use the fast-forward button and increase the number on its right, which controls how many frames are skipped for each rendered frame.
  5. Ultimately, the limiting factor for performance is the robot controller. If that is not optimized, ARGoS won't run fast. I can try and help you through the process of optimizing it.
There is currently no explicit example to do run experiment of this kind, mainly because I had no time to do it. However, I can add a benchmark-like example in which all of these things are explicitly configured, in the style of the other examples. Something like a diffusion_1000 example. Would that suit you?
I made ARGoS.

M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Re: Running a 1000-Robot Simulation

Postby M_Rizk » Wed Oct 14, 2015 1:24 am

Yes. Something like diffusion_1000 would be perfect! Thank you :)

M_Rizk
Posts: 28
Joined: Thu Apr 30, 2015 2:46 am

Re: Running a 1000-Robot Simulation

Postby M_Rizk » Mon Jul 04, 2016 5:40 am

Hi Carlo,

I am having trouble running fast simulations when the number of robots is large. The suggestions you gave me last time help a lot, but I am unsure how to divide the arena into multiple physics engines or optimize grid sizes and I was hoping you could give me some guidance.



Details:

I am trying to simulate a group of foot-bots passing messages to each other. My goal is data collection. The robots pass messages and I log the value they reach consensus on. Ultimately, I will have them moving as well, but even when they are stationary, 10 trials with up to 100 robots (length=200 and ticks_per_second=10) take about 12 hours to run. I have done the following to speed things up:

1. Increased the number of threads to 8, which seems to be the maximum my system can run in parallel (I'm also using the default scheduler since all robots run the same controller)
2. Disabled visualization by uncommenting the visualization section in the .argos file

I wanted to try using multiple physics engines but when I looked through the user manual it didn't specify how physics engines could be configured. Is there somewhere I can find these details, for future reference?

Cheers,
Mostafa

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

Re: Running a 1000-Robot Simulation

Postby pincy » Mon Jul 04, 2016 8:19 pm

Hi Mostafa,

If your bottleneck is communication, there a physics engine can do only a little to make things go faster. I'm a little busy right now with a paper deadline, but as soon as I'm free I'll make an example with multiple engines for you.

Maybe I can help you with some tips on how to optimize C++ code. If you can post your code here, or send it to me privately, I might be able to shave quite some time off your simulations.

Cheers,
Carlo
I made ARGoS.

PeterJohn
Posts: 1
Joined: Fri Nov 11, 2016 6:28 pm

Re: Running a 1000-Robot Simulation

Postby PeterJohn » Wed Nov 16, 2016 7:26 pm

Hi,...i am a new user here. As per my knowledge to improve parallelism, you need to use multiple physics engines, like it's done in the paper. The more you use, the faster ARGoS is. How to divide the arena into multiple physics engines depends on the structure of your arena. The sizes of the physics engines do not need to be identical.


Return to “How to... ?”