Each thread clones its own separate Problem instance. So put it in
your Problem subclass, and clone it when the Problem is cloned like
MyClass myObject; // or myObject = new .... [see setup below]
public void setup(final EvolutionState state,
final Parameter base)
// make the myObject here, loaded from the database or
// just created from scratch. You could also just make
// it in the default constructor or assign it at top
public Object protoClone() throws CloneNotSupportedException
Object returnval = super.protoClone();
myObject = (MyClass)(myObject.clone());
On Feb 7, 2006, at 10:20 AM, Sandeep Mulgund wrote:
> I'm using multiple evaluation threads in my ECJ-based application.
> fitness function needs to use a class that doesn't seem to like
> access from multiple threads. Is there any way I can allocate one
> of this class per eval thread, and if so, where would it go?