ECJ-INTEREST-L Archives

November 2012

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text 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:
SUBSCRIBE ECJ-INTEREST-L Anonymous <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Fri, 9 Nov 2012 22:11:50 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (135 lines)
Hi,

I've created a parameters file.
verbosity = 0

breedthreads = 1
evalthreads = 1
seed.0 = 4357

state = ec.simple.SimpleEvolutionState

pop = ec.Population
init = ec.simple.SimpleInitializer
finish = ec.simple.SimpleFinisher
breed = ec.simple.SimpleBreeder
eval = ec.simple.SimpleEvaluator
stat = ec.simple.SimpleStatistics
exch = ec.simple.SimpleExchanger

generations = 1
quit-on-run-complete = true
checkpoint = false
prefix = ec
checkpoint-modulo = 1

stat.file = out.stat

pop.subpops = 1
pop.subpop.0 = ec.Subpopulation

# The number of individuals(solutions) in a population. Size should be an even
number to breed.
pop.subpop.0.size = 5
pop.subpop.0.duplicate-retries = 0
# Doubles and floats use the FloatVectorSpecies
pop.subpop.0.species = ec.vector.FloatVectorSpecies
pop.subpop.0.species.ind = ec.vector.FloatVectorIndividual
pop.subpop.0.species.fitness = ec.simple.SimpleFitness

# One-point crossover
pop.subpop.0.species.genome-size = 5
pop.subpop.0.species.crossover-type = one
pop.subpop.0.species.crossover-prob = 1.0
# Per-gene mutation probability of 1.0
pop.subpop.0.species.mutation-prob = 1.0

pop.subpop.0.species.pipe = ec.vector.breed.VectorMutationPipeline
pop.subpop.0.species.pipe.source.0 = ec.vector.breed.VectorCrossoverPipeline
pop.subpop.0.species.pipe.source.0.source.0 = ec.select.TournamentSelection
pop.subpop.0.species.pipe.source.0.source.1 = ec.select.TournamentSelection

pop.subpop.0.species.min-gene = 0
pop.subpop.0.species.max-gene = 1
pop.subpop.0.file = pop.in

# Use Gaussian Convolution with a standard deviation of 0.1
pop.subpop.0.species.mutation-type = gauss
pop.subpop.0.species.mutation-stdev = 0.1

select.tournament.size = 2

eval.problem = weightOptimiser.WeightOptimiser

breed.elites.0 = 1

And created a pop.in file with the initial population that I want.

Number of Individuals: i5|
Individual Number: i0|
Evaluated: F
Fitness: f0|0.0|
f1056964608|0.5|f1056964608|0.5|f1056964608|0.5|f1056964608|0.5|f10569
64608|0.5|
Individual Number: i1|
Evaluated: F
Fitness: f0|0.0|
f0|0.0|f0|0.0|f0|0.0|f0|0.0|f0|0.0|
Individual Number: i2|
Evaluated: F
Fitness: f0|0.0|
f1065353216|1.0|f1065353216|1.0|f1065353216|1.0|f1065353216|1.0|f10653
53216|1.0|
Individual Number: i3|
Evaluated: F
Fitness: f0|0.0|
f1048576000|0.25|f1048576000|0.25|f1048576000|0.25|f1048576000|0.25|f1
048576000|0.25|
Individual Number: i4|
Evaluated: F
Fitness: f0|0.0|
f1061158912|0.75|f1061158912|0.75|f1061158912|0.75|f1061158912|0.75|f1
061158912|0.75|


These numbers were generated using the Code class.

System.out.println(Code.encode(0.5f));
System.out.println(Code.encode(0.0f));
System.out.println(Code.encode(1.0f));
System.out.println(Code.encode(0.25f));
System.out.println(Code.encode(0.75f));


This is my evaluate method.

public void evaluate(final EvolutionState state, final Individual ind,
final int subpopulation, final int threadnum) {

if(ind.evaluated)
return;

if( !( ind instanceof FloatVectorIndividual ) )
            state.output.fatal( "The individuals for this problem should be
FloatVectorIndividuals." );


ArrayList<Float> weights = new ArrayList<Float>();
float fitnessValue = 0.00f;
float[] genome = ((FloatVectorIndividual)ind).genome;

fitnessValue = AssessClustersFitness.calculateFitness();

SimpleFitness fitness = (SimpleFitness) ind.fitness;
fitness.setFitness(state, fitnessValue, fitnessValue==1.00);


ind.evaluated = true;
}

But when I run it the "genome" array is empty instead of being populated with
the initial values. Am I missing something here?

Thanks.
Rui

ATOM RSS1 RSS2