diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_peoMoeoPop.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_peoMoeoPop.h new file mode 100644 index 000000000..07c07d6e4 --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_peoMoeoPop.h @@ -0,0 +1,59 @@ +template +peoMoeoPop& do_make_pop(eoParser & _parser, eoState& _state, eoInit & _init) +{ + // random seed + eoValueParam& seedParam = _parser.createParam(uint32_t(0), "seed", "Random number seed", 'S'); + if (seedParam.value() == 0) + seedParam.value() = time(0); + eoValueParam& popSize = _parser.createParam(unsigned(20), "popSize", "Population Size", 'P', "Evolution Engine"); + + // Either load or initialize + // create an empty pop and let the state handle the memory + peoMoeoPop& pop = _state.takeOwnership(peoMoeoPop()); + + eoValueParam& loadNameParam = _parser.createParam(std::string(""), "Load","A save file to restart from",'L', "Persistence" ); + eoValueParam & recomputeFitnessParam = _parser.createParam(false, "recomputeFitness", "Recompute the fitness after re-loading the pop.?", 'r', "Persistence" ); + + if (loadNameParam.value() != "") // something to load + { + // create another state for reading + eoState inState; // a state for loading - WITHOUT the parser + // register the rng and the pop in the state, so they can be loaded, + // and the present run will be the exact continuation of the saved run + // eventually with different parameters + inState.registerObject(pop); + inState.registerObject(rng); + inState.load(loadNameParam.value()); // load the pop and the rng + // the fitness is read in the file: + // do only evaluate the pop if the fitness has changed + if (recomputeFitnessParam.value()) + { + for (unsigned i=0; i popSize.value()) + { + std::cerr << "WARNING, Load file contained too many individuals. Only the best will be retained" << std::endl; + pop.resize(popSize.value()); + } + } + else // nothing loaded from a file + { + rng.reseed(seedParam.value()); + } + + if (pop.size() < popSize.value()) // missing some guys + { + // Init pop from the randomizer: need to use the append function + pop.append(popSize.value(), _init); + } + + // for future stateSave, register the algorithm into the state + _state.registerObject(_parser); + _state.registerObject(pop); + _state.registerObject(rng); + + return pop; +} diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt new file mode 100644 index 000000000..0ca50b99d --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt @@ -0,0 +1,80 @@ + +###################################################################################### +### 0) Set the compiler and define targets to easily run the lessons +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/schema.xml) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/param + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson7) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/schema.xml + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson7) + +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries +###################################################################################### + +IF(NOT WIN32 OR CYGWIN) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib) +ENDIF(NOT WIN32 OR CYGWIN) + +# especially for Visual Studio +IF(WIN32 AND NOT CYGWIN) + LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE} ${ParadisEO-PEO_BINARY_DIR}\\lib\\${CMAKE_BUILD_TYPE}) +ENDIF(WIN32 AND NOT CYGWIN) +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +ADD_EXECUTABLE(algo main.cpp) +ADD_DEPENDENCIES(algo peo rmc_mpi) +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define properties +###################################################################################### + +SET(Lesson7_VERSION ${GLOBAL_VERSION}) +SET_TARGET_PROPERTIES(algo PROPERTIES VERSION "${Lesson7_VERSION}") +###################################################################################### + + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(algo ${XML2_LIBS} peo rmc_mpi eo eoutils) + +###################################################################################### + + + + diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp b/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp new file mode 100644 index 000000000..262c66dbb --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp @@ -0,0 +1,153 @@ +#include +#include + +typedef eoReal Indi; + +double f (const Indi & _indi) +{ + double sum; + sum=_indi[1]-pow(_indi[0],2); + sum=100*pow(sum,2); + sum+=pow((1-_indi[0]),2); + return (-sum); +} + +// Communications between 2 EA and 1 archive + + +int main (int __argc, char *__argv[]) +{ + + peo :: init( __argc, __argv ); + const unsigned int VEC_SIZE = 2; + const unsigned int POP_SIZE = 20; + const unsigned int MAX_GEN = 100; + const double INIT_POSITION_MIN = -2.0; + const double INIT_POSITION_MAX = 2.0; + const float CROSS_RATE = 0.8; + const double EPSILON = 0.01; + const float MUT_RATE = 0.3; + const unsigned int MIG_FREQ = 2; + const unsigned int MIG_SIZE = 2; + rng.reseed (time(0)); + + +// Archive + + peoEvalFunc plainEval(f); + eoEvalFuncCounter < Indi > firstEval(plainEval); + eoPopLoopEval < Indi > evalArchive(firstEval); + eoUniformGenerator < double > uGenArchive (INIT_POSITION_MIN, INIT_POSITION_MAX); + eoInitFixedLength < Indi > randomArchive (VEC_SIZE, uGenArchive); + peoPop < Indi > empty_pop,archive; + archive.append(POP_SIZE, randomArchive); + evalArchive (empty_pop,archive); + archive.sort(); + if (getNodeRank()==1) + std::cout << "Archive before :\n" << archive << std::endl; + + + +// First algorithm + /*****************************************************************************************/ + + RingTopology topology; + + eoGenContinue < Indi > genContPara (MAX_GEN); + eoCombinedContinue continuatorPara (genContPara); + eoCheckPoint checkpoint(continuatorPara); + peoEvalFunc mainEval( f ); + peoPopEval eval(mainEval); + eoUniformGenerator < double >uGen (INIT_POSITION_MIN, INIT_POSITION_MAX); + eoInitFixedLength < Indi > random (VEC_SIZE, uGen); + eoBestSelect selectionStrategy; + eoSelectNumber select(selectionStrategy,POP_SIZE); + eoSegmentCrossover crossover; + eoUniformMutation mutation(EPSILON); + peoTransform transform(crossover,CROSS_RATE,mutation,MUT_RATE); + peoPop < Indi > pop; + pop.append (POP_SIZE, random); + eoPlusReplacement replace; + eoBestSelect mig_select_one; + eoSelector > mig_select (mig_select_one,MIG_SIZE,pop); + eoReplace > mig_replace (replace,pop); + eoPeriodicContinue< Indi > mig_cont( MIG_FREQ ); + eoContinuator cont(mig_cont, pop); + peoAsyncIslandMig< peoPop, peoPop > mig(cont,mig_select, mig_replace, topology); + checkpoint.add(mig); + + + eoRandomSelect mig_select_oneArchive; + eoSelector > mig_selectArchive (mig_select_oneArchive,MIG_SIZE,archive); + eoReplace > mig_replaceArchive (replace,archive); + eoPeriodicContinue< Indi > mig_contArchive( MIG_FREQ ); + eoContinuator contArchive(mig_contArchive, pop); + peoAsyncIslandMig< peoPop, peoPop > migArchive(contArchive,mig_selectArchive, mig_replaceArchive, topology); + checkpoint.add(migArchive); + + eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); + peoWrapper parallelEA( eaAlg, pop); + eval.setOwner(parallelEA); + transform.setOwner(parallelEA); + mig.setOwner(parallelEA); + migArchive.setOwner(parallelEA); + +// Second algorithm +/*****************************************************************************************/ + + eoGenContinue < Indi > genContPara2 (MAX_GEN); + eoCombinedContinue continuatorPara2 (genContPara2); + eoCheckPoint checkpoint2(continuatorPara2); + peoEvalFunc mainEval2( f ); + peoPopEval eval2(mainEval2); + eoUniformGenerator < double >uGen2 (INIT_POSITION_MIN, INIT_POSITION_MAX); + eoInitFixedLength < Indi > random2 (VEC_SIZE, uGen2); + eoBestSelect selectionStrategy2; + eoSelectNumber select2(selectionStrategy2,POP_SIZE); + eoSegmentCrossover crossover2; + eoUniformMutation mutation2(EPSILON); + peoTransform transform2(crossover2,CROSS_RATE,mutation2,MUT_RATE); + peoPop < Indi > pop2; + pop2.append (POP_SIZE, random2); + eoPlusReplacement replace2; + eoBestSelect mig_select_one2; + eoSelector > mig_select2 (mig_select_one2,MIG_SIZE,pop2); + eoReplace > mig_replace2 (replace2,pop2); + eoPeriodicContinue< Indi > mig_cont2( MIG_FREQ ); + eoContinuator cont2(mig_cont2, pop2); + peoAsyncIslandMig< peoPop, peoPop > mig2(cont2,mig_select2, mig_replace2, topology); + checkpoint2.add(mig2); + + + eoRandomSelect mig_select_oneArchive2; + eoSelector > mig_selectArchive2 (mig_select_oneArchive2,MIG_SIZE,archive); + eoReplace > mig_replaceArchive2 (replace2,archive); + eoPeriodicContinue< Indi > mig_contArchive2( MIG_FREQ ); + eoContinuator contArchive2(mig_contArchive2, pop2); + peoAsyncIslandMig< peoPop, peoPop > migArchive2(contArchive2,mig_selectArchive2, mig_replaceArchive2, topology); + checkpoint2.add(migArchive2); + + + + eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); + peoWrapper parallelEA2( eaAlg2, pop2); + eval2.setOwner(parallelEA2); + transform2.setOwner(parallelEA2); + mig2.setOwner(parallelEA2); + migArchive2.setOwner(parallelEA2); + + + peo :: run(); + peo :: finalize(); + if (getNodeRank()==1) + { + pop.sort(); + pop2.sort(); + archive.sort(); + std::cout << "Final population 1 :\n" << pop << std::endl; + std::cout << "Final population 2 :\n" << pop2 << std::endl; + std::cout << "Archive after :\n" << archive << std::endl; + } +} + + diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/param b/trunk/paradiseo-peo/tutorial/Lesson7/param new file mode 100644 index 000000000..730f547e1 --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson7/param @@ -0,0 +1,9 @@ +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=schema.xml + + diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml b/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml new file mode 100644 index 000000000..ba6389de9 --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml @@ -0,0 +1,20 @@ + + + + + + + + + 1 + 2 + + + + + + + + + + diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt new file mode 100644 index 000000000..b24dcee6d --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt @@ -0,0 +1,75 @@ + +###################################################################################### +### 0) Set the compiler and define targets to easily run the lessons +###################################################################################### + +SET (CMAKE_CXX_COMPILER mpicxx) +SET(MAKE_SRC_DIR "${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/make" CACHE PATH "Make source directory" FORCE) + +ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/schema.xml) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/param + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson8) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/schema.xml + ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson8) + +###################################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${FLOWSHOP_SRC_DIR} ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src ${TSP_SRC_DIR} ${MAKE_SRC_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries (mandatory: before 3) ) +###################################################################################### + +IF(NOT WIN32 OR CYGWIN) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${MOEO_BIN_DIR}/lib ${FLOWSHOP_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib ${TSP_BINARY_DIR}/lib) +ENDIF(NOT WIN32 OR CYGWIN) + + + +###################################################################################### + + +###################################################################################### +### 3) Define your target(s): just an executable here +###################################################################################### + +ADD_EXECUTABLE(example main.cpp) +ADD_DEPENDENCIES(example flowshop moeo peo rmc_mpi) + + +###################################################################################### + + +###################################################################################### +### 4) Optionnal: define your target(s)'s version: no effect for windows +###################################################################################### + + +###################################################################################### + +###################################################################################### +### 5) Link the librairies +###################################################################################### + +TARGET_LINK_LIBRARIES(example ${XML2_LIBS} flowshop moeo peo rmc_mpi eo eoutils) + +###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp b/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp new file mode 100644 index 000000000..20562f807 --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp @@ -0,0 +1,116 @@ +#include +#include +#include "parallelStruct.h" +#include +#include + +int main(int argc, char* argv[]) +{ + + peo :: init( argc,argv ); + const unsigned int MIG_FREQ = 10; + const unsigned int MIG_SIZE = 1; + rng.reseed (time(0)); + + +// Global archive + peoMoeoArchive globalArch; + if (getNodeRank()==1) + std::cout << "Archive before :\n" << globalArch << std::endl; + +/***************************************************/ +/***************** First algorithm *****************/ +/***************************************************/ + + // Topology + RingTopology topology; + + // Algorithm + eoParser parser(argc, argv); + eoState state; + peoMoeoPopEval& eval = do_make_para_eval(parser, state); + eoInit& init = do_make_genotype(parser, state); + eoGenOp& op = do_make_op(parser, state); + peoMoeoPop& pop = do_make_pop(parser, state, init); // peoMoeoPop is defined in parallelStruct.h + moeoArchive arch; + eoContinue& term = do_make_continue_moeo(parser, state, eval); + eoCheckPoint < FlowShop> & checkpoint = state.storeFunctor(new eoCheckPoint < FlowShop > (term)); + + // Communication between EA and the global archive + + // Selection mode in the EA + moeoRandomSelect mig_select_one; + moeoSelector > mig_select (mig_select_one,MIG_SIZE,pop); // moeoSelector is defined in parallelStruct.h + // Mode of replacement in the EA + moeoReplace < peoMoeoArchive, peoMoeoPop > mig_replace (pop); // moeoReplace is defined in parallelStruct.h + // Continuator for the island + eoPeriodicContinue< FlowShop> mig_cont( MIG_FREQ ); + eoContinuator cont(mig_cont, pop); + // Communication : EA ---> global archive + peoAsyncIslandMig< peoMoeoPop, peoMoeoArchive > mig(cont,mig_select, mig_replace, topology); + checkpoint.add(mig); + // Selection mode in the global archive + moeoSelectorArchive < peoMoeoArchive > mig_selectArchive (globalArch); // moeoSelectorArchive is defined in parallelStruct.h + // Mode of replacement in the global archive + moeoReplaceArchive < peoMoeoPop, peoMoeoArchive > mig_replaceArchive (globalArch); // moeoReplaceArchive is defined in parallelStruct.h + // Continuator for the island + eoPeriodicContinue< FlowShop> mig_contArchive( MIG_FREQ ); + eoContinuator contArchive(mig_contArchive, pop); + // Communication : global archive ---> EA + peoAsyncIslandMig< peoMoeoArchive, peoMoeoPop > migArchive(contArchive, mig_selectArchive, mig_replaceArchive, topology); + checkpoint.add(migArchive); + + eoAlgo& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch); + peoWrapper parallelMOEO( algo, pop); + eval.setOwner(parallelMOEO); + // Migrations + mig.setOwner(parallelMOEO); + migArchive.setOwner(parallelMOEO); + +/***************************************************/ +/***************************************************/ +/***************************************************/ + +// The same one + + RingTopology topology2; + eoParser parser2(argc, argv); + eoState state2; + peoMoeoPopEval& eval2 = do_make_para_eval(parser2, state2); + eoInit& init2 = do_make_genotype(parser2, state2); + eoGenOp& op2 = do_make_op(parser2, state2); + peoMoeoPop& pop2 = do_make_pop(parser2, state2, init2); + moeoArchive arch2; + eoContinue& term2 = do_make_continue_moeo(parser2, state2, eval2); + eoCheckPoint < FlowShop> & checkpoint2 = state2.storeFunctor(new eoCheckPoint < FlowShop > (term2)); + moeoRandomSelect mig_select_one2; + moeoSelector > mig_select2 (mig_select_one2,MIG_SIZE,pop2); + moeoReplace < peoMoeoArchive, peoMoeoPop > mig_replace2 (pop2); + eoPeriodicContinue< FlowShop> mig_cont2( MIG_FREQ ); + eoContinuator cont2(mig_cont2, pop2); + peoAsyncIslandMig< peoMoeoPop, peoMoeoArchive > mig2(cont2,mig_select2, mig_replace2, topology2); + checkpoint2.add(mig2); + moeoSelectorArchive < peoMoeoArchive > mig_selectArchive2 (globalArch); + moeoReplaceArchive < peoMoeoPop, peoMoeoArchive > mig_replaceArchive2 (globalArch); + eoPeriodicContinue< FlowShop> mig_contArchive2( MIG_FREQ ); + eoContinuator contArchive2(mig_contArchive2, pop2); + peoAsyncIslandMig< peoMoeoArchive, peoMoeoPop > migArchive2(contArchive2, mig_selectArchive2, mig_replaceArchive2, topology2); + checkpoint2.add(migArchive2); + eoAlgo& algo2 = do_make_ea_moeo(parser2, state2, eval2, checkpoint2, op2, arch2); + peoWrapper parallelMOEO2( algo2, pop2); + eval2.setOwner(parallelMOEO2); + mig2.setOwner(parallelMOEO2); + migArchive2.setOwner(parallelMOEO2); + + peo :: run(); + peo :: finalize(); + if (getNodeRank()==1) + { + pop.sort(); + std::cout << "Final population :\n" << pop << std::endl; + pop2.sort(); + std::cout << "Final population :\n" << pop2 << std::endl; + globalArch.sort(); + std::cout << "Archive after :\n" << globalArch << std::endl; + } +} diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h b/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h new file mode 100644 index 000000000..b61e8427b --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h @@ -0,0 +1,137 @@ +template +class peoMoeoPop: public eoPop, public peoData + { + public: + + virtual void pack () + { + ::pack ((unsigned) this->size ()); + for (unsigned i = 0; i < this->size (); i ++) + ::pack ((*this)[i]); + } + + virtual void unpack () + { + unsigned n; + ::unpack (n); + this->resize (n); + for (unsigned i = 0; i < n; i ++) + ::unpack ((*this)[i]); + } + + }; + +template +class peoMoeoArchive: public moeoArchive < MOEOT >, public peoData + { + public: + + virtual void pack () + { + ::pack ((unsigned) this->size ()); + for (unsigned i = 0; i < this->size (); i ++) + ::pack ((*this)[i]); + } + + + virtual void unpack () + { + unsigned n; + ::unpack (n); + this->resize (n); + for (unsigned i = 0; i < n; i ++) + ::unpack ((*this)[i]); + + } + +}; + +template < class EOT, class TYPE> class moeoSelector : public selector< TYPE > + { + public: + + + moeoSelector(moeoSelectOne & _select, unsigned _nb_select, const TYPE & _source): selector (_select), nb_select(_nb_select), source(_source) + {} + + // Example + virtual void operator()(TYPE & _dest) + { + size_t target = static_cast(nb_select); + _dest.resize(target); + for (size_t i = 0; i < _dest.size(); ++i) + _dest[i] = selector(source); + } + + protected: + moeoSelectOne & selector ; + unsigned nb_select; + const TYPE & source; + }; + + + template < class TYPESOUR, class TYPEDEST> class moeoReplaceArchive : public replacement< TYPESOUR > + { + public: + + moeoReplaceArchive(TYPEDEST & _destination): destination(_destination) + {} + + // Example + virtual void operator()(TYPESOUR & _source) + { + destination.update (_source); + } + + protected: + TYPEDEST & destination; + }; + + + + template < class TYPESOUR, class TYPEDEST> class moeoReplace : public replacement< TYPESOUR > + { + public: + + moeoReplace(TYPEDEST & _destination): destination(_destination) + {} + + // Example + virtual void operator()(TYPESOUR & _source) + { + for(unsigned i=0;i<_source.size();i++) + { + unsigned ind=0; + double worst=destination[0].fitness(); + for (unsigned j=1;j class moeoSelectorArchive : public selector< TYPE > + { + public: + + + moeoSelectorArchive(const TYPE & _source): source(_source) + {} + + // Example + virtual void operator()(TYPE & _dest) + { + _dest.update (source); + } + + protected: + const TYPE & source; +}; diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/param b/trunk/paradiseo-peo/tutorial/Lesson8/param new file mode 100644 index 000000000..f2deaa9d6 --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson8/param @@ -0,0 +1,63 @@ +###### General ###### +--help=0 # -h : Prints this message +#--stopOnUnknownParam=1 # Stop if unkown param entered +# --seed=1183379758 # -S : Random number seed + +###### Evolution Engine ###### +--popSize=20 # -P : Population Size +--updateArch=1 # Update the archive at each gen. +--fitness=FastNonDominatedSorting # -F : Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased +--indicator=Epsilon # -i : Binary indicator for IndicatorBased: Epsilon, Hypervolume +--rho=1.1 # -r : reference point for the hypervolume indicator +--kappa=0.05 # -k : Scaling factor kappa for IndicatorBased +--diversity=Crowding # -D : Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding +--comparator=FitnessThenDiversity # -C : Comparator scheme: FitnessThenDiversity, DiversityThenFitness or Aggregative +--selection=DetTour(2) # -S : Selection scheme: DetTour(T), StochTour(t) or Random +--replacement=Elitist # -R : Replacement scheme: Elitist, Environmental or Generational +--nbOffspring=100% # -O : Number of offspring (percentage or absolute) + +###### Output ###### +#--resDir=Res # Directory to store DISK outputs +#--eraseDir=1 # erase files in dirName if any +--printPop=0 # Print sorted pop. every gen. +--storeArch=0 # Store the archive's objective vectors at each gen. +--contribution=0 # Store the contribution of the archive at each gen. +--entropy=0 # Store the entropy of the archive at each gen. + +###### Persistence ###### +--Load= # -L : A save file to restart from +--recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.? +--saveFrequency=0 # Save every F generation (0 = only final state, absent = never) +--saveTimeInterval=0 # Save every T seconds (0 or absent = never) +#--status=./FlowShopEA.status # Status file + +###### Representation ###### +--BenchmarkFile=../../../../paradiseo-moeo/tutorial/examples/flowshop/benchs/020_10_01.txt # -B : Benchmark file name REQUIRED + +###### Stopping criterion ###### +--maxGen=100 # -G : Maximum number of generations (0 = none) +--maxEval=0 # -E : Maximum number of evaluations (0 = none) +--maxTime=0 # -T : Maximum running time in seconds (0 = none) +#--CtrlC=1 # -C : Terminate current generation upon Ctrl C (only available on Unix platforms) + +###### Variation Operators ###### +--crossRate=1 # Relative rate for the only crossover +--shiftMutRate=0.5 # Relative rate for shift mutation +--exchangeMutRate=0.5 # Relative rate for exchange mutation +--pCross=0.25 # -c : Probability of Crossover +--pMut=0.35 # -m : Probability of Mutation + + + +## miscallenous parameters + +--debug=false + +## deployment schema + +--schema=schema.xml + +## parameters + +--inst=../examples/tsp/benchs/eil101.tsp + diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml b/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml new file mode 100644 index 000000000..23da1d55e --- /dev/null +++ b/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml @@ -0,0 +1,16 @@ + + + + + + + + 1 + 2 + + + + + + +