Updated makefiles, updated the moo stuff and cleaned up some stuff that refused to compile

This commit is contained in:
maartenkeijzer 2007-11-12 16:23:57 +00:00
commit 18adaef056
19 changed files with 66 additions and 48 deletions

View file

@ -5,7 +5,14 @@ libeomoo_a_SOURCES = eoFrontSorter.cpp \
eoNSGA_IIa_Eval.cpp \
eoNSGA_II_Eval.cpp
pkginclude_HEADERS = eoFrontSorter.h \
eoMOFitness.h
pkginclude_HEADERS =\
eoEpsilonArchive.h\
eoEpsMOEA.h\
eoFrontSorter.h\
eoMOEval.h\
eoMOFitness.h\
eoNSGA_I_Eval.h\
eoNSGA_IIa_Eval.h\
eoNSGA_II_Eval.h
AM_CXXFLAGS = -I$(top_srcdir)/src

View file

@ -16,7 +16,7 @@ class eoEpsMOEA : public eoAlgo<EOT> {
eoEvalFunc<EOT>& _eval,
eoGenOp<EOT>& _op,
const std::vector<double>& eps,
unsigned max_archive_size
unsigned max_archive_size = std::numeric_limits<unsigned>::max()
) : continuator(_continuator),
eval (_eval),
loopEval(_eval),

View file

@ -114,26 +114,6 @@ exitLoop:
}
}
/*
static unsigned counter = 0;
if (++counter % 500 == 0) {
std::vector<long> mins(archive[0].discretized.size(), std::numeric_limits<long>::max());
std::vector<long> maxs(archive[0].discretized.size(), std::numeric_limits<long>::min());
for (unsigned i = 0; i < archive.size(); ++i) {
for (unsigned dim = 0; dim < archive[i].discretized.size(); ++dim) {
mins[dim] = std::min( mins[dim], archive[i].discretized[dim] );
maxs[dim] = std::max( maxs[dim], archive[i].discretized[dim] );
}
}
std::cout << "Range ";
for (unsigned dim = 0; dim < mins.size(); ++dim) {
std::cout << (maxs[dim] - mins[dim]) << ' ';
}
std::cout << archive.size() << std::endl;
}*/
if (archive.size() > max_size) {
unsigned idx = rng.random(archive.size());
if (idx != archive.size()-1) std::swap(archive[idx], archive.back());

View file

@ -1,6 +1,5 @@
#include <limits>
#include <eoNSGA_II_Eval.h>
#include <moo/eoNSGA_II_Eval.h>
namespace nsga2 {

View file

@ -25,7 +25,7 @@ class eoNSGA_II_Eval : public eoMOEval<EOT>
eoNSGA_II_Eval(eoPopEvalFunc<EOT>& eval) : eoMOEval<EOT>(eval) {}
virtual void operator()(eoPop<EOT>& parents, eoPop<EOT>& offspring) {
eval(parents, offspring);
this->eval(parents, offspring);
std::vector<EOT*> pop;
pop.reserve(parents.size() + offspring.size());