Corrected a few small problems - including dependencies in Makefile
thanks to Sebastiao CORREIA for pointing them out
This commit is contained in:
parent
11b3eabfca
commit
03308af599
4 changed files with 32 additions and 10 deletions
|
|
@ -4,6 +4,17 @@
|
||||||
|
|
||||||
.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -DF2C -I. -I../../src -I./util -Wall -g -c $*.cpp
|
.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.1\" -DF2C -I. -I../../src -I./util -Wall -g -c $*.cpp
|
||||||
|
|
||||||
|
# local sources
|
||||||
|
LOCAL_SOURCES = MyStructEA.cpp \
|
||||||
|
eoMyStruct.h \
|
||||||
|
eoMyStructEvalFunc.h \
|
||||||
|
eoMyStructInit.h \
|
||||||
|
eoMyStructMutation.h \
|
||||||
|
eoMyStructQuadCrossover.h \
|
||||||
|
make_genotype_MyStruct.h \
|
||||||
|
make_op_MyStruct.h
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# START eventually modify the name of EO dir
|
# START eventually modify the name of EO dir
|
||||||
DIR_EO = ../../src
|
DIR_EO = ../../src
|
||||||
|
|
@ -22,4 +33,6 @@ all : $(ALL)
|
||||||
|
|
||||||
clean : ; /bin/rm *.o $(ALL)
|
clean : ; /bin/rm *.o $(ALL)
|
||||||
|
|
||||||
|
########## local dependencies
|
||||||
|
AppliEA.o : $(LOCAL_SOURCES)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,13 @@ using namespace std;
|
||||||
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
// START fitness type: double or eoMaximizingFitness if you are maximizing
|
// START fitness type: double or eoMaximizingFitness if you are maximizing
|
||||||
// eoMinimizingFitness if you are minimizing
|
// eoMinimizingFitness if you are minimizing
|
||||||
typedef eoMyStruct<double> Indi; // ***MUST*** derive from EO
|
typedef eoMinimizingFitness MyFitT ; // type of fitness
|
||||||
// END fitness type
|
// END fitness type
|
||||||
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
|
||||||
|
// Then define your EO objects using that fitness type
|
||||||
|
typedef eoMyStruct<MyFitT> Indi; // ***MUST*** derive from EO
|
||||||
|
|
||||||
// create an initializer
|
// create an initializer
|
||||||
#include "make_genotype_MyStruct.h"
|
#include "make_genotype_MyStruct.h"
|
||||||
eoInit<Indi> & make_genotype(eoParameterLoader& _parser, eoState&_state, Indi _eo)
|
eoInit<Indi> & make_genotype(eoParameterLoader& _parser, eoState&_state, Indi _eo)
|
||||||
|
|
|
||||||
|
|
@ -30,18 +30,23 @@ First, let's choose a name: let's call the new EO class eoAppli.
|
||||||
All newly created classes will be named eoAppliXXX (in the file
|
All newly created classes will be named eoAppliXXX (in the file
|
||||||
eoAppliXXX)
|
eoAppliXXX)
|
||||||
|
|
||||||
1- choose a directory name for your application in the tutorial dir,
|
1- cd to the tutorial dir
|
||||||
"parallel" to the LessonX dirs (though any name can do, of course, we
|
|
||||||
will suppose its full name, from the / root dir, is APPLICATION in
|
|
||||||
what follows)
|
|
||||||
|
|
||||||
2- cd to the tutorial/Templates dir
|
2- create the directory for your application (let's assume you call it
|
||||||
|
APPLICATION): type in
|
||||||
|
|
||||||
3- run the helper script create.sh with the following arguments
|
mkdir APPLICATION
|
||||||
create.sh Appli APPLICATION
|
|
||||||
|
|
||||||
4- cd to the APPLICATION dir. You should see there the following
|
3- go to the Templates dir
|
||||||
files:
|
|
||||||
|
cd Templates
|
||||||
|
|
||||||
|
and run the helper script create.sh with the following arguments
|
||||||
|
|
||||||
|
./create.sh Appli ../APPLICATION
|
||||||
|
|
||||||
|
4- cd to the APPLICATION dir (cd ../APPLICATION).
|
||||||
|
You should see there the following files:
|
||||||
AppliEA.cpp the main file, includes all other, to be compiled
|
AppliEA.cpp the main file, includes all other, to be compiled
|
||||||
Makefile with default target eoAppliEA
|
Makefile with default target eoAppliEA
|
||||||
eoAppli.h class eoAppli<FitT>, FitT = template fitness
|
eoAppli.h class eoAppli<FitT>, FitT = template fitness
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ public:
|
||||||
// END Code of default Ctor of an eoMyStruct object
|
// END Code of default Ctor of an eoMyStruct object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual string className() const { return "eoMyStruct"; }
|
||||||
|
|
||||||
/** printing... */
|
/** printing... */
|
||||||
void printOn(ostream& os) const
|
void printOn(ostream& os) const
|
||||||
|
|
|
||||||
Reference in a new issue