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

@ -10,11 +10,10 @@ DEPS = $(top_builddir)/src/libeo.a $(top_builddir)/src/utils/libeoutils.a
INCLUDES = -I$(top_builddir)/src
LDADDS = $(top_builddir)/src/libeo.a $(top_builddir)/src/utils/libeoutils.a
CXXFLAGS = -g
###############################################################################
bin_PROGRAMS = gprop
###############################################################################
gprop_SOURCES = gprop.cc

View file

@ -109,11 +109,11 @@ mlp::set trn_set, val_set, tst_set;
class eoChromMutation: public eoMonOp<Chrom>
{
public:
void operator()(Chrom& chrom)
bool operator()(Chrom& chrom)
{
mse::net tmp(chrom);
tmp.train(trn_set, 10, 0, 0.001);
chrom.invalidate();
return true;
}
};
@ -124,7 +124,7 @@ public:
class eoChromXover: public eoQuadOp<Chrom>
{
public:
void operator()(Chrom& chrom1, Chrom& chrom2)
bool operator()(Chrom& chrom1, Chrom& chrom2)
{
chrom1.normalize();
chrom2.desaturate();
@ -132,8 +132,8 @@ public:
mse::net tmp1(chrom1), tmp2(chrom2);
tmp1.train(trn_set, 100, 0, 0.001);
tmp2.train(trn_set, 100, 0, 0.001);
chrom1.invalidate();
chrom2.invalidate();
return true;
}
};