ECJ-INTEREST-L Archives

April 2013

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Sun, 21 Apr 2013 12:25:24 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (72 lines)
0. Be sure you're using the SVN repository version of ECJ, not the tarball version.
1. You seem to have a hard wrap in your text file below, breaking the genomes into two lines.
2. Ignore the first once-only warning.
3. The file below has two individuals named "i2|".  That's the cause of the second warning.
4. I can't tell what's going on with your null pointer exception, it's inside your code, sorry.
5. PrintIndividual needs the EvolutionState because it needs the Output facility.  Is there a reason this won't be available but you'd still want to print printIndividual?  You can recreate most of printIndividual by just writing out the right text and the right genome encodings (use ec/util/Code.java).

Sean

On Apr 21, 2013, at 7:19 AM, SUBSCRIBE ECJ-INTEREST-L Anonymous wrote:

> Hi,
> 
> I need to produce an initial population. I have taken a look at earlier posts 
> on generating initial population and the example in the manual. I've tried 
> using the Coder like in one of the posts. I have added the genome count 
> and have gotten it to run. However, I got an error as such.
> 
> ONCE-ONLY WARNING:
> On reading subpopulation from text stream, some of the preexisting 
> subpopulation's slots were null.
> Had to use newIndividual() instead of readIndividual().  If you're starting 
> an evolutionary run by reading an
> existing population from a file, this is expected -- ignore this message.
> ONCE-ONLY WARNING:
> On reading subpopulation from text stream, some individual indexes in the 
> subpopulation did not match.
> The first was individual 1, which is listed in the file as 2
> Exception in thread "Thread-8" java.lang.NullPointerException
> 	at MyOptimiser.MyOptimiser.evaluate(MyOptimiser.java:81)
> 	at 
> ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:146)
> 	at ec.simple.SimpleEvaluatorThread.run(SimpleEvaluator.java:177)
> 	at java.lang.Thread.run(Unknown Source)
> Generation 1
> 
> 
> My pop.in file looks like this.
> 
> Number of Individuals: i2|
> Individual Number: i0|
> Evaluated: F
> Fitness: f0|0.0| 
> i4|f1056964608|0.5|f1056964608|0.5|f1056964608|0.5|f1056964608|0.
> 5|
> Individual Number: i1|
> Evaluated: F
> Fitness: f0|0.0|
> i4|f1065353216|1.0|f1065353216|1.0|f1065353216|1.0|f1065353216|1.
> 0|
> Individual Number: i2|
> Evaluated: F
> Fitness: f0|0.0|
> i4|f1048576000|0.25|f1048576000|0.25|f1048576000|0.25|f104857600
> 0|0.25|
> Individual Number: i3|
> Evaluated: F
> Fitness: f0|0.0|
> i4|f1061158912|0.75|f1061158912|0.75|f1061158912|0.75|f106115891
> 2|0.75|
> 
> Oddly, when I don't add the third individual I will get a preamble error 
> where Indiviudal Number: is expected.
> 
> There was a comment about using printIndividual(..). How can I use this 
> method? The method requires EvolutionState, ParameterDatabase etc. I 
> have a set of individuals that I want to format external from the ECJ 
> framework itself. Is there a way that I can use printIndividual(..) without 
> having to construct the whole framework?
> 
> thanks.

ATOM RSS1 RSS2