diff --git a/eo/tutorial/ParadisEO/Lesson2/Makefile.am b/eo/tutorial/ParadisEO/Lesson2/Makefile.am deleted file mode 100644 index 8a856631..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -noinst_PROGRAMS = MasterDistEvalBitEA SlaveDistEvalBitEA - -LIBEO = $(top_builddir)/src/libeo.a -LIBEOUTILS = $(top_builddir)/src/utils/libeoutils.a - -CXX = $(MPICXX) -LD = $(MPICXX) -AM_CXXFLAGS = -I$(top_srcdir)/src -DEPS = $(LIBEOUTILS) $(LIBEO) -LIBS = $(LIBEOUTILS) $(LIBEO) - - -noinst_HEADERS = binary_value.h - -MasterDistEvalBitEA_SOURCES = MasterDistEvalBitEA.cpp - -SlaveDistEvalBitEA_SOURCES = SlaveDistEvalBitEA.cpp diff --git a/eo/tutorial/ParadisEO/Lesson2/Makefile.simple b/eo/tutorial/ParadisEO/Lesson2/Makefile.simple deleted file mode 100644 index 87ea5380..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/Makefile.simple +++ /dev/null @@ -1,23 +0,0 @@ -MPICC = mpiCC - -ALL = MasterDistEvalBitEA SlaveDistEvalBitEA - -lesson2 : MasterDistEvalBitEA SlaveDistEvalBitEA - -all : $(ALL) - -clean : - @/bin/rm $(ALL) *.o *~ - -MasterDistEvalBitEA : MasterDistEvalBitEA.o - $(MPICC) -DPACKAGE=\"eo\" -o MasterDistEvalBitEA MasterDistEvalBitEA.o ../../../src/utils/libeoutils.a ../../../src/libeo.a - -MasterDistEvalBitEA.o : MasterDistEvalBitEA.cpp binary_value.h - $(MPICC) -DPACKAGE=\"eo\" -I. -I../../../src -c MasterDistEvalBitEA.cpp - -SlaveDistEvalBitEA : SlaveDistEvalBitEA.o - $(MPICC) -DPACKAGE=\"eo\" -o SlaveDistEvalBitEA SlaveDistEvalBitEA.o ../../../src/utils/libeoutils.a ../../../src/libeo.a - -SlaveDistEvalBitEA.o : SlaveDistEvalBitEA.cpp binary_value.h - $(MPICC) -DPACKAGE=\"eo\" -I. -I../../../src -c SlaveDistEvalBitEA.cpp - diff --git a/eo/tutorial/ParadisEO/Lesson2/MasterDistEvalBitEA.cpp b/eo/tutorial/ParadisEO/Lesson2/MasterDistEvalBitEA.cpp deleted file mode 100644 index e98e3d0d..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/MasterDistEvalBitEA.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#ifdef HAVE_SSTREAM -#include -#else -#include -#endif - -#include -#include - -typedef eoBit Indi ; // A bitstring with fitness double - -#include "binary_value.h" - -using namespace std; - -void main_function(int argc, char **argv) { - - // Some parameters - const unsigned int SEED = 42 ; // Seed for random number generator - const unsigned int T_SIZE = 3 ; // Size for tournament selection - const unsigned int VEC_SIZE = 8 ; // Number of bits in genotypes - const unsigned int POP_SIZE = 100 ; // Size of population - - const unsigned int MAX_GEN = 20 ; // Maximum number of generation before STOP - - const double P_CROSS = 0.8 ; // Crossover probability - const double P_MUT = 1.0 ; // Mutation probability - const double P_MUT_PER_BIT = 0.01 ; // Internal probability for bit-flip mutation - const double onePointRate = 0.5 ; // Rate for 1-pt Xover - const double bitFlipRate = 0.5 ; // Rate for bit-flip mutation - - rng.reseed (SEED) ; - - eoEvalFuncPtr & > eval (binary_value) ; - - eoUniformGenerator uGen ; - eoInitFixedLength random (VEC_SIZE, uGen) ; - - eoPop pop (POP_SIZE, random) ; - - apply (eval, pop) ; - - eoDetTournamentSelect selectOne (T_SIZE) ; - - eoSelectPerc select (selectOne) ; - - eoGenerationalReplacement replace ; - - eo1PtBitXover xover1 ; - - eoBitMutation mutationBitFlip(P_MUT_PER_BIT) ; - - // The operators are encapsulated into an eoTRansform object - eoSGATransform transform(xover1, P_CROSS, mutationBitFlip, P_MUT); - - eoGenContinue genCont (MAX_GEN); - - eoEasyEA gga (genCont, eval, select, transform, replace); - - eoListener listen (argc, argv) ; - - eoDistEvalEasyEA dist_gga (listen, gga, "Mars") ; - - dist_gga (pop) ; - - listen.destroy ("Mars") ; - - // OUTPUT - // Print (sorted) intial population - pop.sort(); - cout << "FINAL Population\n" << pop << endl; -// GENERAL -} - -// A main that catches the exceptions - -int main(int argc, char **argv) -{ - - try - { - main_function(argc, argv); - } - catch(exception& e) - { - cout << "Exception: " << e.what() << '\n'; - } - - return 1; -} diff --git a/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA.cpp b/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA.cpp deleted file mode 100644 index cf7a9420..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include // runtime_error -#ifdef HAVE_SSTREAM -#include -#else -#include -#endif - -#include -#include - -typedef eoBit Indi; // A bitstring with fitness double - -#include "binary_value.h" - -using namespace std; - -void main_function(int argc, char **argv) { - - eoEvalFuncPtr & > eval (binary_value) ; - - eoListener listen (argc, argv) ; - - eoEvaluator evaluator ("Mars", - listen, - eval) ; - - // Runs - evaluator () ; -} - -// A main that catches the exceptions - -int main(int argc, char **argv) -{ - - try - { - main_function(argc, argv); - } - catch(exception& e) - { - cout << "Exception: " << e.what() << '\n'; - } - - return 1; -} diff --git a/eo/tutorial/ParadisEO/Lesson2/binary_value.h b/eo/tutorial/ParadisEO/Lesson2/binary_value.h deleted file mode 100644 index f2f5d6ca..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/binary_value.h +++ /dev/null @@ -1,17 +0,0 @@ -#include - -//----------------------------------------------------------------------------- - -/** Just a simple function that takes binary value of a chromosome and sets - the fitnes. - @param _chrom A binary chromosome -*/ -// INIT -double binary_value(const std::vector& _chrom) -{ - double sum = 0; - for (unsigned i = 0; i < _chrom.size(); i++) - sum += _chrom[i]; - return sum; -} - diff --git a/eo/tutorial/ParadisEO/Lesson2/paradiseo.config b/eo/tutorial/ParadisEO/Lesson2/paradiseo.config deleted file mode 100644 index 8c1e07af..00000000 --- a/eo/tutorial/ParadisEO/Lesson2/paradiseo.config +++ /dev/null @@ -1,4 +0,0 @@ -${MACHINE0} 0 ${HOME}/eo/tutorial/ParadisEO/Lesson2/MasterDistEvalBitEA -${MACHINE0} 1 ${HOME}/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA -${MACHINE1} 1 ${HOME}/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA -${MACHINE2} 1 ${HOME}/eo/tutorial/ParadisEO/Lesson2/SlaveDistEvalBitEA diff --git a/eo/tutorial/ParadisEO/Lesson3/CellularBitEA.cpp b/eo/tutorial/ParadisEO/Lesson3/CellularBitEA.cpp deleted file mode 100644 index f1773cc0..00000000 --- a/eo/tutorial/ParadisEO/Lesson3/CellularBitEA.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include // runtime_error -#ifdef HAVE_SSTREAM -#include -#else -#include -#endif - -#include -#include - -typedef eoBit Indi; - -#include "binary_value.h" - -using namespace std; - -void main_function(int argc, char **argv) -{ - - const unsigned int SEED = 42; - const unsigned int VEC_SIZE = 8; - const unsigned int POP_SIZE = 25; - - const unsigned int MAX_GEN = 100; - - const double P_MUT_PER_BIT = 0.01; - - rng.reseed(SEED); - - eoEvalFuncPtr& > eval( binary_value ); - - eoUniformGenerator uGen; - eoInitFixedLength random(VEC_SIZE, uGen); - - eoPop pop(POP_SIZE, random); - - - apply(eval, pop); - - pop.sort(); - - cout << "Initial Population" << endl; - cout << pop; - - eo1PtBitXover xover1; - - eoBitMutation mutationBitFlip(P_MUT_PER_BIT); - - eoGenContinue genCont(MAX_GEN); - - eoBestSelect select ; - - eoToricCellularEasyEA gga (genCont, - eval, - select, - xover1, - mutationBitFlip, - select, - select) ; - - cout << "\n Here we go\n\n"; - gga(pop); - - pop.sort(); - cout << "FINAL Population\n" << pop << endl; - -} - -// A main that catches the exceptions - -int main(int argc, char **argv) -{ -#ifdef _MSC_VER - // rng.reseed(42); - int flag = _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); - flag |= _CRTDBG_LEAK_CHECK_DF; - _CrtSetDbgFlag(flag); -// _CrtSetBreakAlloc(100); -#endif - - try - { - main_function(argc, argv); - } - catch(exception& e) - { - cout << "Exception: " << e.what() << '\n'; - } - - return 1; -} diff --git a/eo/tutorial/ParadisEO/Lesson3/Makefile.am b/eo/tutorial/ParadisEO/Lesson3/Makefile.am deleted file mode 100644 index 13dbcc30..00000000 --- a/eo/tutorial/ParadisEO/Lesson3/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -noinst_PROGRAMS = CellularBitEA - -LIBEO = $(top_builddir)/src/libeo.a -LIBEOUTILS = $(top_builddir)/src/utils/libeoutils.a - -CXX = $(MPICXX) -LD = $(MPICXX) -AM_CXXFLAGS = -I$(top_srcdir)/src -DEPS = $(LIBEOUTILS) $(LIBEO) -LIBS = $(LIBEOUTILS) $(LIBEO) - - -noinst_HEADERS = binary_value.h - -CellularBitEA_SOURCES = CellularBitEA.cpp diff --git a/eo/tutorial/ParadisEO/Lesson3/Makefile.simple b/eo/tutorial/ParadisEO/Lesson3/Makefile.simple deleted file mode 100644 index 3b255b38..00000000 --- a/eo/tutorial/ParadisEO/Lesson3/Makefile.simple +++ /dev/null @@ -1,16 +0,0 @@ -.SUFFIXES: .cpp -.cpp: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../../src -Wall -g -o $@ $*.cpp ../../../src/utils/libeoutils.a ../../../src/libeo.a - -.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -I. -I../../../src -Wall -g -c $*.cpp - -ALL = CellularBitEA - -lesson3 : $(firstEA) - -all : $(ALL) - -clean : - @/bin/rm $(ALL) *.o *~ - -CellularBitEA : binary_value.h - diff --git a/eo/tutorial/ParadisEO/Lesson3/binary_value.h b/eo/tutorial/ParadisEO/Lesson3/binary_value.h deleted file mode 100644 index f2f5d6ca..00000000 --- a/eo/tutorial/ParadisEO/Lesson3/binary_value.h +++ /dev/null @@ -1,17 +0,0 @@ -#include - -//----------------------------------------------------------------------------- - -/** Just a simple function that takes binary value of a chromosome and sets - the fitnes. - @param _chrom A binary chromosome -*/ -// INIT -double binary_value(const std::vector& _chrom) -{ - double sum = 0; - for (unsigned i = 0; i < _chrom.size(); i++) - sum += _chrom[i]; - return sum; -} -