Problem setting population sorting on MSVC (and bugs?)
ymossel at hotmail.com
Thu Dec 12 10:35:26 EST 2002
regarding the first problem try using:
see example 23.
----Original Message Follows----
From: "Fredric V. Echols" <rwf at gpcom.net>
Reply-To: galib at mit.edu
To: <galib at mit.edu>
Subject: Problem setting population sorting on MSVC (and bugs?)
Date: Tue, 10 Dec 2002 16:07:09 -0600
I am using a system in which a genetic algorithm is being used to
produce signals, and the fitness function works by determining signal error
using Mean Squared Error. Obviously, the lower the error, the better the
genome is. Anyway, when I try to set the population to use the "lower is
better" mode, I get this from MSVC 6.0:
"error C2663: 'order' : 2 overloads have no legal conversion for 'this'
Here is the relevant code:
// Genome type
#define GenomeT unsigned char
#define GAGenomeT GA1DArrayAlleleGenome<GenomeT>
// Allele set
GAAlleleSet<GenomeT> Allele(0, 255);
GAGenomeT genome(2, Allele, Objective);
// Set up genome
// Set sort order
The last line is where the problem lies, according to the compiler.
There is also another problem... I manually set the sort order to
LOW_IS_BEST in GAPopulation.cpp and recompiled the library, which worked to
a certain extent. However, when running in this mode, elitism does not seem
to work correctly, and the best individual in the population (using
GASimpleGA) will vary from step to step in the evolution. Here's an example
output of my test program showing the vacillation:
Why would it keep "bouncing" between values like this? Is elitism
for LOW_IS_BEST ordering, or is something wrong with my code?
Thanks for your time!
galib mailing list
galib at mit.edu
Protect your PC - get McAfee.com VirusScan Online
More information about the galib