Is there any function to ???

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Is there any function to ???

wcancino (Bugzilla)
Hi everyone,

This is my first message here in the list, I am beginner to use

JGAP. I tried to read all the concerned documentation and I

have some question that I cannot find in the FAQ.

Currently I am working in a GP program with some sort

of symbolic regresssion in mind with user feedback.

The idea is that the user have the abillity of directly manipulate

the formulas (individuals) provided by the GP.

It is a function that allows to "inject" an individual to the population

during the evolution? For instance I want to insert the "x+y" individual, so

I am looking for a function that traduces a string to a tree GP representation.

I just find the opposite function.


Waldo Cancino
INRIA Saclay Ile de France

2012/2/3 disgruntled_young_man <[hidden email]>

So I was going about my night, enjoying coding in Java because it's such a
fun language, and after attempting to remove all chromosomes in my
population that were the same (to only have uniques) I received an error
during evolve because there was  < the expected population size before the
evolution started:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Array
index out of range: 0
       at java.util.Vector.get(
       at backtest_gp.Backtest_GP.<init>(
       at backtest_gp.Backtest_GP.main(


So I'm all like, "that's cool, I remember seeing a sweet function called
'fillPopulation', I'll just give that a whirl!"

Much to my dismay:

Exception in thread "main" org.jgap.InvalidConfigurationException: No
initializer found for class class
       at backtest_gp.Backtest_GP.<init>(
       at backtest_gp.Backtest_GP.main(

Huh.  That's weird.  Alright I'll be proactive and check the source for

public void fillPopulation(final int a_num)
     throws InvalidConfigurationException {
   IGPProgram sampleProg = getGPConfiguration().getPrototypeProgram();
   if (sampleProg == null) {
     /**@todo care about*/
   Class sampleClass = sampleProg.getClass();
   IInitializer chromIniter = getGPConfiguration().getJGAPFactory().
       getInitializerFor(sampleProg, sampleClass);
   if (chromIniter == null) {
     throw new InvalidConfigurationException("No initializer found for
class "
         + sampleClass);
   try {
     for (int i = 0; i < a_num; i++) {
       /**@todo implement filling up population*/
//        getGPPopulation().addChromosome( (IChromosome)
//            sampleClass, null));
   } catch (Exception ex) {
     throw new IllegalStateException(ex);

Come on, really?  Ugh.  Any ETA on when this could be done?
View this message in context:
Sent from the jgap-users mailing list archive at

Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
jgap-users mailing list
[hidden email]

Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
jgap-users mailing list
[hidden email]