On Apr 21, 2013, at 5:22 PM, SUBSCRIBE ECJ-INTEREST-L Anonymous wrote:
> 0. Be sure you're using the SVN repository version of ECJ, not the tarball
> version.
> ---> Yes, its from the SVN.
Are you sure? When I load this population into ecsuite, I get a different set of warnings and it runs fine:
java ec.Evolve \
-file ec/app/ecsuite/ecsuite.params \
-p pop.subpop.0.file=/tmp/foo.in \
-p pop.subpop.0.species.genome-size=4
.... I get ...
WARNING:
Subpopulation is reading from a file, but no extra-behavior provided. By default, subpopulation will be truncated to fit the file size.
ONCE-ONLY WARNING:
On reading subpopulation from text stream, the current subpopulation size didn't match the number of individuals in the file. The size of the subpopulation will be revised accordingly. There were 2 individuals in the file and 1000 individuals expected for the subopulation.
Old subpopulation was of size 1000, truncating to size 2
This is the new behavior for ECJ's population loading. It's telling me that the subpopulation is supposed to be 1000 but only 2 individuals were provided, and so the default behavior it will follow in that situation is to truncate the population to 2 (there are two other behavior options). The code works fine with 2, 3, or 4 individuals set in the file (i2| or i3| or i4|)
Anyway, your posted warnings do not match this. It makes me suspect you're possibly not using the SVN version.
> 3. The file below has two individuals named "i2|". That's the cause of the
> second warning.
> ---> If you are referring to "Individual Number: i0|", there are no
> duplicates.
You're right, I had misread the message.
> 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).
> ---> I want to quickly test ECJ with an initial population to see if its what I
> need, without having to dig for days simply to understand its workings. If
> you have a simple example, that would be very helpful.
It depends on the representation. But here are some simple rules (note the hint in the FLOAT discussion below):
A BOOLEAN is written as either: T or F
An INTEGER is written as: iX| where X is the integer value. Example: i22|
A FLOAT is written as: fX|Y| where Y is the floating-point representation and X is the integer representation of the same bits (for exactness). Example: f1048576000|0.25| ECJ will use X to determine the precise value and will ignore Y. However if you omit X, then ECJ will use Y (you still have to write both | symbols). This is useful if you are a human and don't know these bits. So as a human you could just write: f|0.25|
A DOUBLE VECTOR INDIVIDUAL or FLOAT VECTOR INDIVIDUAL is written as:
Evaluated: BOOLEAN
Fitness: FLOAT
GENOME
Where GENOME is an INTEGER indicating the number of genes, followed by a FLOAT for each gene. Example:
Evaluated: F
Fitness: f0|0.0|
i4|f1056964608|0.5|f1056964608|0.5|f1056964608|0.5|f1056964608|0.5|
A SUBPOPULATION is written as:
Number of Individuals: INTEGER
Individual Number: INTEGER
INDIVIDUAL
Individual Number: INTEGER
INDIVIDUAL
Individual Number: INTEGER
INDIVIDUAL
Individual Number: INTEGER
INDIVIDUAL
... and so on. That's the file you're trying to read in. You can also read in entire POPULATIONS but it's rarely done.
If you want to print this from some other application, you can do so by just printing out the right stuff (ignoring the bit representation in the float). Or you can use ec/util/Code.java to write out the bit representation as well.
Sean
|