Running Multiple GA's simultaneously

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Running Multiple GA's simultaneously

gururise
I'm working on a large problem that has several different distinct parts.  I would like to run multiple GA's to optimize each distinct part of the problem.  I have created three separate classes, each with their own separate GA/fitness function; however, it seems JGAP will only allow one instance of a Configuration object to be instantiated at once.

Attempting to create multiple Configuration objects which point to different fitness functions results in the error message:

Exception in thread "main" java.lang.RuntimeException: Fitness evaluator has already been set differently.
If you want to set or construct a configuration multiple times, please call static method Configuration.reset() before each setting!
    at org.jgap.Configuration.checkProperty(Configuration.java:566)
    at org.jgap.Configuration.setFitnessEvaluator(Configuration.java:1274)
    at org.jgap.impl.DefaultConfiguration.<init>(DefaultConfiguration.java:64)
    at org.jgap.impl.DefaultConfiguration.<init>(DefaultConfiguration.java:34)


Is there any way to allow for multiple instances of GA's in JGAP?

Thank You

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: Running Multiple GA's simultaneously

Klaus Meffert-5
Gene,
 
it is possible using multiple instances. You have to set a unique ID with the configuration at construction.
 
Please find attached a simple example that demonstrates this.
 
Best
 


From: Gene Ruebsamen [mailto:[hidden email]]
Sent: Monday, May 16, 2011 6:24 PM
To: [hidden email]
Subject: [jgap-users] Running Multiple GA's simultaneously

I'm working on a large problem that has several different distinct parts.  I would like to run multiple GA's to optimize each distinct part of the problem.  I have created three separate classes, each with their own separate GA/fitness function; however, it seems JGAP will only allow one instance of a Configuration object to be instantiated at once.

Attempting to create multiple Configuration objects which point to different fitness functions results in the error message:

Exception in thread "main" java.lang.RuntimeException: Fitness evaluator has already been set differently.
If you want to set or construct a configuration multiple times, please call static method Configuration.reset() before each setting!
    at org.jgap.Configuration.checkProperty(Configuration.java:566)
    at org.jgap.Configuration.setFitnessEvaluator(Configuration.java:1274)
    at org.jgap.impl.DefaultConfiguration.<init>(DefaultConfiguration.java:64)
    at org.jgap.impl.DefaultConfiguration.<init>(DefaultConfiguration.java:34)


Is there any way to allow for multiple instances of GA's in JGAP?

Thank You

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users

SimpleExample.java (3K) Download Attachment
MaxFunction.java (1K) Download Attachment