Well, what do you know, major commit.

Changed the signature of eoMon, eoBin and eoQuadOp to return a bool,
without invalidating fitness. Added a set of invalidators to take over
that job (see for instance eoSGA and eoSGATransform how this can transparantly used)

Derived eoState from eoFunctorStore (for convenience, from a design perspective this may sound wrong)

Added a wrap_op function that does the wrapping for you (see eoOpContainer how this made this functor
exceedingly less hairy). Checked all the tests removed the eoGeneric*Op family (not needed anymore)
and of course changed all the operators to reflect the change (and found a few that didn't
invalidate the fitness, thus really pointing out the advantage of the current approach)
This commit is contained in:
maartenkeijzer 2001-02-14 10:35:26 +00:00
commit 3a9b5a0e7e
30 changed files with 651 additions and 564 deletions

View file

@ -3,7 +3,7 @@
//-----------------------------------------------------------------------------
// eoSGA.h
// (c) Marc.Schoenauer 2000 - Maarten Keijzer 2000
/*
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@ -27,7 +27,7 @@
#ifndef _eoSGATransform_h
#define _eoSGATransform_h
#include <eoOp.h>
#include <eoInvalidateOps.h>
#include <eoPop.h>
///////////////////////////////////////////////////////////////////////////////
@ -148,16 +148,16 @@ template<class EOT> class eoDynSGATransform : public eoTransform<EOT>
};
// accessors - mainly for EASEA
double & PCrossHandle() { return crossoverProba;}
double & PMutHandle() { return mutationProba;}
double & PMutHandle() { return mutationProba;}
private:
// difference with eoSGATransform: the operator probabilities
// they can be passed by reference or by value.
// hence we need here to use a reference, and to eventually store a value
eoQuadOp<EOT>& cross;
eoInvalidateQuadOp<EOT> cross;
double crossoverProbaHolder; // the value, used only if ctor gets a value
double& crossoverProba; // the reference, to be used in operator()
eoMonOp<EOT>& mutate;
eoInvalidateMonOp<EOT> mutate;
double mutationProbaHolder; // the value, used only if ctor gets a value
double& mutationProba; // the reference, to be used in operator()
};