December 2007


Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sean Luke <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Mon, 17 Dec 2007 23:26:04 -0500
text/plain (60 lines)
The job mechanism is intended to allow you to fiddle with parameters  
based on job information, but you have to override a hook manually.   
You can either:

	- make your own main() method, or add code to the existing one and  
recompile.  This isn't remotely so bad as it sounds, just look at the  
existing Evolve.main method and there's a spot where you can add your  
code.  You can tell the job number (it's an integer called, oddly,  

	- override EvolutionState.startFresh() in your own EvolutionState  
subclass (or scribble it into EvolutionState, where startFresh() is  
empty).  This is my suggested hook.  Here the job number will be an  
Integer stored in the instance variable self.job[0]

Either way, you can change parameters in the ParameterDatabase by  
just calling state.parameters.set(new Parameter(key), value), where  
key is a String representing the parameter key, and value is the  
String you want to set it to.  Let's say you want to change  
pop.subpop.0.duplicate-retries=100 when the job number is more than  
4.  You might write something like:

import ec.util.*;
import ec.simple.*;
public class MyEvolutionState extends SimpleEvolutionState   /*  
assuming you're using that */
	public void startFresh()
		int job = ((Integer)(self.job[0])).intValue();
		if (job > 4)
			self.parameters.set(new Parameter("pop.subpop.0.duplicate- 
retries"), "100");
			self.parameters.set(new Parameter("pop.subpop.0.duplicate- 
retries"), "0");

... now you just change your EvolutionState parameter in your  
parameter file:

	state =

Or something like that.


On Dec 17, 2007, at 7:49 PM, [log in to unmask] wrote:

> Hi,
> I was wondering if it were possible to change the parameter values  
> for each job. Currently I have the Job number set to 3 and was  
> wondering if I could then have three different values for the max- 
> gene variable, a different variable for each job?
> Thanks in advance.