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.

Regards,

Waldo Cancino
INRIA Saclay Ile de France
AVIZ Team



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(Vector.java:694)
       at org.jgap.gp.impl.TournamentSelector.select(TournamentSelector.java:91)
       at org.jgap.gp.impl.GPGenotype.evolve(GPGenotype.java:732)
       at backtest_gp.Backtest_GP.<init>(Backtest_GP.java:353)
       at backtest_gp.Backtest_GP.main(Backtest_GP.java:369)

----------

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 org.jgap.gp.impl.GPProgram
       at org.jgap.gp.impl.GPGenotype.fillPopulation(GPGenotype.java:1205)
       at backtest_gp.Backtest_GP.<init>(Backtest_GP.java:313)
       at backtest_gp.Backtest_GP.main(Backtest_GP.java:369)

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


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)
chromIniter.perform(sampleProg,
//            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: http://old.nabble.com/GPGenotype.fillPopulation----not-implemented---tp33254179p33254179.html
Sent from the jgap-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
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!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users


------------------------------------------------------------------------------
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.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users