From 65a985631c73caf31e4fdfa48fc410fd56d0fa9c Mon Sep 17 00:00:00 2001 From: gustavoromero Date: Tue, 28 Nov 2000 13:36:29 +0000 Subject: [PATCH] now works --- eo/app/gprop/gprop.cc | 6 +----- eo/app/gprop/gprop.h | 7 ++++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/eo/app/gprop/gprop.cc b/eo/app/gprop/gprop.cc index e3a9835a..1ba88280 100644 --- a/eo/app/gprop/gprop.cc +++ b/eo/app/gprop/gprop.cc @@ -11,7 +11,7 @@ #include // eoPop #include // eoGenContinue #include // eoProportional -#include +#include // eoStochTournament #include // eoSGA #include "gprop.h" // Chrom eoChromInit eoChromMutation eoChromXover eoChromEvaluator @@ -92,10 +92,6 @@ void arg(int argc, char** argv) in = trn_set.front().input.size(); out = trn_set.front().output.size(); hidden = hiddenp.value(); - - cout << trn_set << endl; - - cout << in << " " << out << " " << hidden << endl; } //----------------------------------------------------------------------------- diff --git a/eo/app/gprop/gprop.h b/eo/app/gprop/gprop.h index f36a1c4b..7a913496 100644 --- a/eo/app/gprop/gprop.h +++ b/eo/app/gprop/gprop.h @@ -30,11 +30,9 @@ struct phenotype static unsigned trn_max, val_max, tst_max; - // operator double(void) const { return val_ok; } - friend bool operator<(const phenotype& a, const phenotype& b) { - return a.val_ok < b.val_ok; // || (!(a.val_ok < b.val_ok) && a.mse_error < b.mse_error); + return a.val_ok < b.val_ok || !(b.val_ok < a.val_ok) && b.mse_error < a.mse_error; } friend ostream& operator<<(ostream& os, const phenotype& p) @@ -119,6 +117,7 @@ public: { mse::net tmp(chrom); tmp.train(trn_set, 10, 0, 0.001); + chrom.invalidate(); } private: @@ -140,6 +139,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(); } };