Simultaneous Runs

Requests regarding how to set up experiments in ARGoS.
randusr
Posts: 4
Joined: Fri Jan 19, 2018 9:21 am

Simultaneous Runs

Postby randusr » Tue Feb 27, 2018 10:07 am

I'm trying to evolve controllers in argos.
As the algorithm is written in Java, I use JNI to launch ARGoS.

Currently I am creating the Simulator at the beginning of the algorithm, then do sequential executions.
I'd like to run the simulation simulatneous, much like in the galib-example, but without a fixed set of instances.

I would be very happy with a solution, that uses a method, that can be called multible times and just instantiates a complete independent instance of ARGoS.

Currently I'm trying something of the following:

Code: Select all

double LaunchArgos(int genome[], int length) { CSimulator &cSimulator = argos::CSimulator::GetInstance(); cSimulator.SetExperimentFileName("experiments/construction-nsga2.argos"); cSimulator.LoadExperiment(); [...] cLoopFunctions.ConfigureFromGenome(genome, length); cSimulator.Execute(); return cLoopFunctions.Performance() }
My guess is, that the problem lies with the Singleton CSimulator.

Is there a way to get around this?

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

Re: Simultaneous Runs

Postby pincy » Tue Feb 27, 2018 8:30 pm

Yes, check the MPGA example. MPGA stands for "multi-process genetic algorithm". In brief, it spawns a separate process for every instance of ARGoS you want to run in parallel.
I made ARGoS.


Return to “How to... ?”