Print

Print


[log in to unmask]">

Dear,

 

I've done as instructed, but when I use the output log file as the input file for this parameter: pop.subpop.0.file = <filename>, I got the error:

 

| ECJ

| An evolutionary computation system (version 11)

| Copyright 2004 by Sean Luke

| URL: http://www.cs.umd.edu/projects/plus/ec/ecj/

| Mail: [log in to unmask]

| Date: March 5, 2004

| Current Java: 1.4.2_04 / Java HotSpot(TM) Client VM-1.4.2_04-b05

| Suggested Minimum Java: 1.2.2

| Required Minimum Java: 1.1

 

 

Threads:  breed/1 eval/1

Seed: 4357

Setting up

Initializing Generation 0

FATAL ERROR:

Reading Line 2: Bad 'Evaluated?' line.

 

If you have a sample input file for initial population, please send me.

 

Thank you,

Duong.

 

-----Original Message-----
From: ECJ Evolutionary Computation Toolkit [mailto:[log in to unmask]] On Behalf Of Sean Luke
Sent:
Saturday, July 24, 2004 2:18 AM
To: [log in to unmask]
Subject: Re: Customized initial population and execution time in ECJ

 

On Jul 23, 2004, at 1:40 PM, #TA NGUYEN BINH DUONG# wrote:

 

> Thank you for your help. But what's the format of the file to init the

> population? I could not find it anywhere in the documents provided.

 

Each subpopulation can load from a separate file, where each individual

is written, in order, to that file using the format produced with

Individual.printIndividual(...).

 

If you'd like to see what such a file looks like, change SimpleFinisher

to look like this, and it will write out a file at the end of the

evolutionary run for Subpopulation 0:

 

package ec.simple;

import ec.Finisher;

import ec.EvolutionState;

import ec.util.Parameter;

 

public class SimpleFinisher extends Finisher

     {

     public void setup(final EvolutionState state, final Parameter base)

{ }

     public void finishPopulation(final EvolutionState state, final int

result)

         {

         try

             {

             int log = state.output.addLog(

                 new java.io.File("example.log"),0,false,false);

             for (int

x=0;x<state.population.subpops[0].individuals.length;x++)

                 {

                 ec.Individual i =

state.population.subpops[0].individuals[x];

                 i.printIndividual(state,log,100);

                 }

             }

         catch (java.io.IOException e) { }

         return;

         }

     }