On Dec 10, 2015, at 12:28 PM, Axel Kowald <[log in to unmask]> wrote:

> I would like to use ECJ to optimize some parameters of my MASON
> simulation, but I somehow can't find a tutorial or example that shows how to do it. Can you please point me in the right direction ?
 
I can't find my old examples -- I may have to build some new ones.  In general, you might look at Section 2.7.1 of the ECJ manual, which discusses how to use ECJ to optimize a simulation from a simulation toolkit.  It doesn't mention MASON specifically, but one approach is fairly straightforward:

- In your [ECJ] EvolutionState make a variable called

	public MySimState[/* num threads */] simulations;

- In your [ECJ] Problem.evaluate method, if state.simulations[threadnum] == null, construct a MASON SimState.  Otherwise call state.simulations[threadnum].finish().  In either case, THEN modify state.simulations[threadnum] to reflect the settings of the individual you're optimizing.  THEN repeatedly call state.simulations[threadnum].step(...) until you're done.  THEN extract the relevant statistics from state.simulations[threadnum] to determine the fitness of the individual, and set the individual's fitness appropriately.

- In your [ECJ] Finisher.finishPopulation(...) method, call finish() on any non-null SimStates in simulations, clean them up, and set them to null.

Sean