From 33f3b82974f640126532bbc47e03ea461d91681d Mon Sep 17 00:00:00 2001 From: jboisson Date: Tue, 23 Sep 2008 21:36:40 +0000 Subject: [PATCH] minor modifications for GCC 4.3.0 compatibility git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1239 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-mo/src/moBestImprSelect.h | 9 +++++++++ trunk/paradiseo-mo/tutorial/examples/tsp/graph.h | 1 + trunk/paradiseo-moeo/src/algo/moeoEasyEA.h | 6 ++++++ trunk/paradiseo-moeo/src/do/make_checkpoint_moeo.h | 2 ++ .../examples/flowshop/FlowShopBenchmarkParser.cpp | 4 +++- .../tutorial/examples/flowshop/FlowShopBenchmarkParser.h | 1 + .../tutorial/examples/flowshop/FlowShopEval.cpp | 9 ++++++++- trunk/paradiseo-peo/src/core/thread.h | 2 +- trunk/paradiseo-peo/src/rmc/mpi/mess.cpp | 4 ++-- trunk/paradiseo-peo/src/rmc/mpi/mess.h | 2 ++ trunk/paradiseo-peo/src/rmc/mpi/node.cpp | 1 + trunk/paradiseo-peo/src/rmc/mpi/schema.h | 1 + trunk/paradiseo-peo/src/rmc/mpi/xml_parser.h | 1 + trunk/paradiseo-peo/tutorial/examples/tsp/opt_route.h | 2 ++ 14 files changed, 40 insertions(+), 5 deletions(-) diff --git a/trunk/paradiseo-mo/src/moBestImprSelect.h b/trunk/paradiseo-mo/src/moBestImprSelect.h index 2bb6c9bd0..c3aa6c2b5 100755 --- a/trunk/paradiseo-mo/src/moBestImprSelect.h +++ b/trunk/paradiseo-mo/src/moBestImprSelect.h @@ -61,6 +61,10 @@ class moBestImprSelect:public moMoveSelect < M > Fitness fitness; fitness=(Fitness)_fitness; + //std::cout.precision(10); + + //std::cout << "old fitness = " << _fitness << std::endl; + first_time = true; } @@ -84,6 +88,8 @@ class moBestImprSelect:public moMoveSelect < M > first_time = false; } + //std::cout << "best fitness = " << best_fitness << std::endl; + return true; } @@ -101,6 +107,9 @@ class moBestImprSelect:public moMoveSelect < M > _move = best_move; _fitness = best_fitness; + + + //std::cout << "Final fitness = " << best_fitness << std::endl; } private: diff --git a/trunk/paradiseo-mo/tutorial/examples/tsp/graph.h b/trunk/paradiseo-mo/tutorial/examples/tsp/graph.h index eb53ade4c..94b66d7f6 100644 --- a/trunk/paradiseo-mo/tutorial/examples/tsp/graph.h +++ b/trunk/paradiseo-mo/tutorial/examples/tsp/graph.h @@ -43,6 +43,7 @@ #include #include #include +#include namespace Graph diff --git a/trunk/paradiseo-moeo/src/algo/moeoEasyEA.h b/trunk/paradiseo-moeo/src/algo/moeoEasyEA.h index 20cb0c8b8..a6a6e5561 100755 --- a/trunk/paradiseo-moeo/src/algo/moeoEasyEA.h +++ b/trunk/paradiseo-moeo/src/algo/moeoEasyEA.h @@ -169,14 +169,20 @@ class moeoEasyEA: public moeoEA < MOEOT > unsigned int pSize = _pop.size(); offspring.clear(); // new offspring // fitness and diversity assignment (if you want to or if it is the first generation) + //std::cout << "eval ou first time" << std::endl; if (evalFitAndDivBeforeSelection || firstTime) { firstTime = false; + //std::cout << "fitness eval" << std::endl; fitnessEval(_pop); + //std::cout << "diversity eval" << std::endl; diversityEval(_pop); } + //std::cout << "breed" << std::endl; breed(_pop, offspring); + //std::cout << "pop eval" << std::endl; popEval(_pop, offspring); // eval of parents + offspring if necessary + //std::cout << "replace" << std::endl; replace(_pop, offspring); // after replace, the new pop. is in _pop if (pSize > _pop.size()) { diff --git a/trunk/paradiseo-moeo/src/do/make_checkpoint_moeo.h b/trunk/paradiseo-moeo/src/do/make_checkpoint_moeo.h index e24d7a23b..188c340ea 100755 --- a/trunk/paradiseo-moeo/src/do/make_checkpoint_moeo.h +++ b/trunk/paradiseo-moeo/src/do/make_checkpoint_moeo.h @@ -38,6 +38,7 @@ #ifndef MAKE_CHECKPOINT_MOEO_H_ #define MAKE_CHECKPOINT_MOEO_H_ +#include #include #include #include @@ -52,6 +53,7 @@ #include #include + bool testDirRes(std::string _dirName, bool _erase); /** diff --git a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp index 5a8b412b5..14c50c493 100644 --- a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp +++ b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp @@ -106,7 +106,8 @@ void FlowShopBenchmarkParser::init(const std::string _benchmarkFileName) // initial and current seeds (not used) getline(inputFile, buffer, '\n'); // processing times and due-dates - p = std::vector< std::vector > (M,N); + //p = std::vector< std::vector > (M,N); + p.resize(N); d = std::vector (N); // for each job... for (unsigned int j=0 ; j #include #include #include diff --git a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopEval.cpp b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopEval.cpp index 08465a6f8..1f9fea0b4 100644 --- a/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopEval.cpp +++ b/trunk/paradiseo-moeo/tutorial/examples/flowshop/FlowShopEval.cpp @@ -77,7 +77,14 @@ double FlowShopEval::tardiness(const FlowShop & _flowshop) std::vector< std::vector > FlowShopEval::completionTime(const FlowShop & _flowshop) { - std::vector< std::vector > C(M,N); + //std::vector< std::vector > C(M,N); + std::vector< std::vector > C; + C.resize(M); + for(unsigned int i=0;i - +#include /* A high-level thread */ class Thread diff --git a/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp b/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp index d2f79bb50..c65fc49e8 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp +++ b/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp @@ -41,7 +41,7 @@ #include "../../core/peo_debug.h" #include "node.h" -#define MPI_BUF_SIZE 1024*64 +#define MPI_BUF_SIZE 1024*512 static char mpi_buf [MPI_BUF_SIZE]; @@ -89,7 +89,7 @@ void cleanBuffers () void waitBuffers () { - printDebugMessage ("waiting the termination of the asynchronous operations to complete"); + // printDebugMessage ("waiting the termination of the asynchronous operations to complete"); for (unsigned i = 0; i < act_req.size (); i ++) { diff --git a/trunk/paradiseo-peo/src/rmc/mpi/mess.h b/trunk/paradiseo-peo/src/rmc/mpi/mess.h index 12da4c287..3e2c73046 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/mess.h +++ b/trunk/paradiseo-peo/src/rmc/mpi/mess.h @@ -37,6 +37,8 @@ #ifndef __mess_rmc_h #define __mess_rmc_h +#include + #include "../../core/messaging.h" extern void initMessage (); diff --git a/trunk/paradiseo-peo/src/rmc/mpi/node.cpp b/trunk/paradiseo-peo/src/rmc/mpi/node.cpp index 6b3e55e36..12e8a4194 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/node.cpp +++ b/trunk/paradiseo-peo/src/rmc/mpi/node.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include "mess.h" diff --git a/trunk/paradiseo-peo/src/rmc/mpi/schema.h b/trunk/paradiseo-peo/src/rmc/mpi/schema.h index 8d3164b10..444a6eb78 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/schema.h +++ b/trunk/paradiseo-peo/src/rmc/mpi/schema.h @@ -40,6 +40,7 @@ #include #include #include +#include #include "node.h" #include "../../core/runner.h" diff --git a/trunk/paradiseo-peo/src/rmc/mpi/xml_parser.h b/trunk/paradiseo-peo/src/rmc/mpi/xml_parser.h index fc521f98b..ccfb1ad84 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/xml_parser.h +++ b/trunk/paradiseo-peo/src/rmc/mpi/xml_parser.h @@ -38,6 +38,7 @@ #define __xml_parser_h #include +#include extern void openXMLDocument (const char * __filename); diff --git a/trunk/paradiseo-peo/tutorial/examples/tsp/opt_route.h b/trunk/paradiseo-peo/tutorial/examples/tsp/opt_route.h index d454a7b82..3179756dc 100644 --- a/trunk/paradiseo-peo/tutorial/examples/tsp/opt_route.h +++ b/trunk/paradiseo-peo/tutorial/examples/tsp/opt_route.h @@ -39,6 +39,8 @@ #include #include +#include +#include #include "route.h"