Added #ifdef HAVE_GNUPLOT for Windows compatibility

This commit is contained in:
tlegrand 2007-09-19 11:45:19 +00:00
commit 6b0cfffe09
8 changed files with 38 additions and 6 deletions

View file

@ -24,7 +24,7 @@ double real_value (const Particle & _particle)
}
main()
int main()
{
const unsigned int VEC_SIZE = 2;
const unsigned int POP_SIZE = 20;

View file

@ -1,4 +1,8 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <eo>
#include <moo/eoMOFitness.h>
@ -178,6 +182,7 @@ void the_main(int argc, char* argv[])
cp.add(fitness0);
cp.add(fitness1);
#ifdef HAVE_GNUPLOT
eoGnuplot1DSnapshot snapshot("pareto");
//snapshot.with(eoGnuplot::Points(3));
@ -185,6 +190,7 @@ void the_main(int argc, char* argv[])
snapshot.add(fitness0);
snapshot.add(fitness1);
#endif
// the algo
eoEasyEA<eoDouble> ea(cp, eval, breeder, replace);

View file

@ -24,6 +24,10 @@
/** test program for PBIL algorithm */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>
#include <eo>
#include <ga/make_ga.h>
@ -34,6 +38,7 @@
#include <ga/eoPBILAdditive.h>
#include <eoSimpleEDA.h>
using namespace std;
typedef eoBit<double> Indi;
@ -97,6 +102,7 @@ int main(int argc, char* argv[])
"Output - Graphical");
if (plotDistribParam.value())
{
#ifdef HAVE_GNUPLOT
unsigned frequency=1; // frequency of plots updates
eoGnuplot1DSnapshot *distribSnapshot = new eoGnuplot1DSnapshot(ptDirNameParam->value(),
frequency, "distrib");
@ -105,6 +111,7 @@ int main(int argc, char* argv[])
distribSnapshot->add(distrib);
// and of course add it to the checkpoint
checkpoint.add(*distribSnapshot);
#endif
}
// the algorithm: EDA

View file

@ -1,4 +1,8 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <eo>
//#include <utils/eoMOFitnessStat.h>
@ -225,6 +229,7 @@ void the_main(int argc, char* argv[])
cp.add(fitness0);
cp.add(fitness1);
#ifdef HAVE_GNUPLOT
eoGnuplot1DSnapshot snapshot("pareto");
//snapshot.with(eoGnuplot::Points(3));
@ -232,6 +237,7 @@ void the_main(int argc, char* argv[])
snapshot.add(fitness0);
snapshot.add(fitness1);
#endif
// the algo
eoEasyEA<eoDouble> ea(cp, eval, breeder, replace);

View file

@ -1,4 +1,9 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <time.h>
#include <eoSecondsElapsedContinue.h>
#include <eoPop.h>
#include <EO.h>
@ -12,7 +17,7 @@ int main() {
int s = 1;
eoSecondsElapsedContinue<Dummy> cnt(1);
time_t start_time = time(0);
time_t start_time = time(0);
while (cnt(pop)) {}