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

@ -108,4 +108,10 @@ t_eoEasyPSO_SOURCES = t-eoEasyPSO.cpp
t_eoNSGA_SOURCES = t-eoNSGA.cpp
t_eoFrontSorter_SOURCES = t-eoFrontSorter.cpp
t_eoEpsMOEA_SOURCES = t-eoEpsMOEA.cpp
t_eoInt_SOURCES = t-eoInt.cpp
t_eoInitPermutation_SOURCES = t-eoInitPermutation.cpp
t_eoSwapMutation_SOURCES = t-eoSwapMutation.cpp
t_eoShiftMutation_SOURCES = t-eoShiftMutation.cpp
t_eoTwoOptMutation_SOURCES = t-eoTwoOptMutation.cpp
t_eoRingTopology_SOURCES = t-eoRingTopology.cpp

View file

@ -9,7 +9,6 @@
typedef EO<float> Chrom;
//-----------------------------------------------------------------------------
int main()
{
Chrom chrom1, chrom2;
@ -17,6 +16,7 @@ int main()
std::cout << "chrom1 = " << chrom1 << std::endl
<< "chrom2 = " << chrom2 << std::endl;
return 0;
}

View file

@ -2,6 +2,7 @@
#include <eo>
#include <moo/eoEpsMOEA.h>
#include <utils/eoFuncPtrStat.h>
using namespace std;
@ -133,6 +134,17 @@ class Init : public eoInit<eoDouble>
}
};
template <class EOT>
unsigned get_size(const eoPop<EOT>& pop) {
return pop.size();
}
template <class EOT>
unsigned counter(const eoPop<EOT>& pop) {
static unsigned c = 0;
return c++;
}
// Test pareto dominance and perf2worth, and while you're at it, test the eoGnuPlot monitor as well
void the_main(int argc, char* argv[])
{
@ -174,7 +186,20 @@ void the_main(int argc, char* argv[])
snapshot.add(fitness0);
snapshot.add(fitness1);
eoGnuplot1DMonitor monitor("sizemon");
cp.add(monitor);
eoFuncPtrStat<eoDouble, unsigned> size(get_size<eoDouble>);
eoFuncPtrStat<eoDouble, unsigned> counterStat(counter<eoDouble>);
monitor.add(counterStat);
monitor.add(size);
cp.add(size);
cp.add(counterStat);
// the algo
eoEpsMOEA<eoDouble> ea(cp, eval, opsel, MinimizingFitnessTraits::eps );