[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Questions related to Breeder
From: |
Xiaodong Li |
Subject: |
Questions related to Breeder |
Date: |
Wed, 18 Apr 2001 14:40:01 +1000 |
Hi Marcus
I was testing the Breeder 2.1 with a multi-modal function De Jong's F5,
then I noticed that the following code did not always give the minimum
fitness value from the popList (as you can see from the plotted graph
"Fitness Evolution", the minimum fitness has gone up close to the
maximum fitness very quickly only after generation 40):
-------------------------------------------------------------
[fitnessGraph createMinSequence: "Min fitness"
withFeedFrom: [populationSwarm getList]
andSelector: M(getFitness) ];
-------------------------------------------------------------
However if I add a line of code (shown below) to the "-evaluate" in
popSwarm.m, to see each member's fitness:
//_______________________________________________________________
-evaluate { // Evaluates all member of the population
//_______________________________________________________________
// Takes them from the new list and places then in the Population map,
// keyed with fitness
id index, member;
index = [newPopList begin: [self getZone]];
while ( ( member = [index next]) ) {
char* saux = calloc( STRSIZE, sizeof( char ) );
// Must be allocated to be used as key
float result = ((*evalFunc)( member )) ;
[member setFitness: result];
sprintf( saux, "%f", result );
// test to see a member's fitness
printf("the member's fitness is: %f at generation %d\n", result,
generationCount);
if (! [popList at: (id) saux insert: member ] ) {
[SourceMessage raiseEvent : "Something is wrong\n" ];
}
}
[index drop];
// now remove all members of the list
index = [newPopList begin: [self getZone]];
while ( ( member = [index next]) ) {
[index remove];
}
[index drop];
return self;
}
-----------------------------------------------------------------
And you can see there are still members with fitness values close to
0.0. Because F5 have many sharp peaks as well as low valleys, this is
expected. However these lower fitness values are not shown up in the
minimum fitness sequence in the "Fitness Evolution" graph.
Can anyone suggest what has gone wrong here?
Thanks for the help.
-- Xiaodong
==================================
Swarm-Modelling is for discussion of Simulation and Modelling techniques
esp. using Swarm. For list administration needs (esp. [un]subscribing),
please send a message to <address@hidden> with "help" in the
body of the message.
==================================
- Questions related to Breeder,
Xiaodong Li <=