Page 1 of 1

Simultaneous Runs

Posted: Tue Feb 27, 2018 10:07 am
by randusr
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?

Re: Simultaneous Runs

Posted: Tue Feb 27, 2018 8:30 pm
by pincy
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.