* mutation.tmpl, quadCrossover.tmpl, stat.tmpl: Initialize formerly

uninitialized variables.

* README.tmpl: Hint to regular Templates/README for details.

* README: Add documentation for adding new source-files.

* Makefile.am.src-tmpl (noinst_HEADERS): Add
(MyStruct_SOURCES): Move header files from here to the new
noinst_HEADERS variable.
This commit is contained in:
kuepper 2007-02-22 08:27:32 +00:00
commit 8acc9dcbce
7 changed files with 54 additions and 30 deletions

View file

@ -1,3 +1,16 @@
2007-02-22 Jochen Küpper <jochen@fhi-berlin.mpg.de>
* mutation.tmpl, quadCrossover.tmpl, stat.tmpl: Initialize
formerly uninitialized variables.
* README.tmpl: Hint to regular Templates/README for details.
* README: Add documentation for adding new source-files.
* Makefile.am.src-tmpl (noinst_HEADERS): Add
(MyStruct_SOURCES): Move header files from here to the new
noinst_HEADERS variable.
2007-01-16 Jochen Küpper <jochen@fhi-berlin.mpg.de>
* README: Add instructions for bash.

View file

@ -1,12 +1,12 @@
bin_PROGRAMS = MyStruct
MyStruct_SOURCES = MyStructEA.cpp \
eoMyStruct.h \
noinst_HEADERS = eoMyStruct.h \
eoMyStructEvalFunc.h \
eoMyStructInit.h \
eoMyStructMutation.h \
eoMyStructQuadCrossover.h
MyStruct_SOURCES = MyStructEA.cpp
dnl Local Variables:

View file

@ -4,10 +4,11 @@ a script createEOproject.sh to create a complete new EO project.
The template requires a complete installation of EO, that is, you must
have run "make install" in the build-directory.
In particular, the C++ compiler must find the EO include files and the
linker must find the EO libraries. Most probably, that means that you
have to set the variables CPLUS_INCLUDE_PATH and LIBRARY_PATH, i.e.
for a standard installation and using tcsh:
In particular, the C++ compiler must also know how to find the EO
include files and the linker must find the EO libraries. Most
probably, that means that you have to set the variables
CPLUS_INCLUDE_PATH and LIBRARY_PATH, i.e. for a standard installation
and using tcsh:
setenv CPLUS_INCLUDE_PATH /usr/local/include/eo:"$CPLUS_INCLUDE_PATH"
setenv LIBRARY_PATH /usr/local/lib:"$LIBRARY_PATH"
@ -15,6 +16,7 @@ When running bash, use this:
export CPLUS_INCLUDE_PATH=/usr/local/include/eo:"$CPLUS_INCLUDE_PATH"
export LIBRARY_PATH=/usr/local/lib:"$LIBRARY_PATH"
You can freely move the created project around. However, whenever you
change the location of the source- or build-directories, you need to
run
@ -24,4 +26,9 @@ in the source-directory and
in the build-directory (which might or might not be the same for you).
When you add additional source files to the project, simply add them
to the <myproj>_SOURCES variable in src/Makefile.am. Header files
should be added to noinst_HEADERS.
See README.manual for more details.

View file

@ -1,17 +1,21 @@
This is an autogenerated EO project.
It was (most probably) generated using the createEOproject.sh
script in the ...eo-dir/tutorial/Templates directory.
This is an autogenerated EO project. It was (most probably) generated
using the createEOproject.sh script in the
<eo-dir>/tutorial/Templates directory.
The project has a complete build-infrastructure based on
automake/autoconf. You can simply run "make" in this directory to have
the program compiled. The executable build will be in src/.
In case of problem during this step, please read the README file
in the ...eo-dir/tutorial/Templates directory.
the program compiled. The executable build will be in src/. In case of
problem during this step, please read the README file in the
...eo-dir/tutorial/Templates directory.
After creation, the project should compile nicely - but of course
the resulting program does noting at all but print a few silly lines.
After creation, the project should compile nicely - but of course the
resulting program does noting at all but print a few silly lines.
Fill in the marked code-snippets in the files in src/ and you have a
complete EA project (detailed explanations in EO Tutorial - Lesson 5).
Enjoy!
For details, for example on moving your project around or adding new
files, see <eo-dir>/tutorial/Templates/README.

View file

@ -14,14 +14,14 @@ Template for simple mutation operators
#include <eoOp.h>
/**
/**
* Always write a comment in this format before class definition
* if you want the class to be documented by Doxygen
*
* THere is NO ASSUMPTION on the class GenoypeT.
* In particular, it does not need to derive from EO
*/
template<class GenotypeT>
template<class GenotypeT>
class eoMyStructMutation: public eoMonOp<GenotypeT>
{
public:
@ -30,7 +30,7 @@ public:
*/
// START eventually add or modify the anyVariable argument
eoMyStructMutation()
// eoMyStructMutation( varType _anyVariable) : anyVariable(_anyVariable)
// eoMyStructMutation( varType _anyVariable) : anyVariable(_anyVariable)
// END eventually add or modify the anyVariable argument
{
// START Code of Ctor of an eoMyStructEvalFunc object
@ -44,9 +44,9 @@ public:
* modifies the parent
* @param _genotype The parent genotype (will be modified)
*/
bool operator()(GenotypeT & _genotype)
bool operator()(GenotypeT & _genotype)
{
bool isModified;
bool isModified(true);
// START code for mutation of the _genotype object
/** Requirement

View file

@ -15,14 +15,14 @@ Quadratic crossover operators modify the both genotypes
#include <eoOp.h>
/**
/**
* Always write a comment in this format before class definition
* if you want the class to be documented by Doxygen
*
* THere is NO ASSUMPTION on the class GenoypeT.
* In particular, it does not need to derive from EO
*/
template<class GenotypeT>
template<class GenotypeT>
class eoMyStructQuadCrossover: public eoQuadOp<GenotypeT>
{
public:
@ -31,7 +31,7 @@ public:
*/
// START eventually add or modify the anyVariable argument
eoMyStructQuadCrossover()
// eoMyStructQuadCrossover( varType _anyVariable) : anyVariable(_anyVariable)
// eoMyStructQuadCrossover( varType _anyVariable) : anyVariable(_anyVariable)
// END eventually add or modify the anyVariable argument
{
// START Code of Ctor of an eoMyStructEvalFunc object
@ -47,9 +47,9 @@ public:
* @param _genotype1 The first parent
* @param _genotype2 The second parent
*/
bool operator()(GenotypeT& _genotype1, GenotypeT & _genotype2)
bool operator()(GenotypeT& _genotype1, GenotypeT & _genotype2)
{
bool oneAtLeastIsModified;
bool oneAtLeastIsModified(true);
// START code for crossover of _genotype1 and _genotype2 objects
/** Requirement

View file

@ -14,15 +14,15 @@ Template for computing statistics on eoPop
// include the base definition of eoInit
#include <utils/eoStat.h>
/**
/**
* Always write a comment in this format before class definition
* if you want the class to be documented by Doxygen
*
* ASSUMPTION on the class GenoypeT:
* ASSUMPTION on the class GenoypeT:
* it needs to derive from EO (i.e. has a Fitness).
*
* It is assumed that you want to compute a double.
* In case you want something else, then your stat should derive from
* It is assumed that you want to compute a double.
* In case you want something else, then your stat should derive from
* eoStat<GenotypeT, T>
* where class T is the class of the computed statistics
*/
@ -33,7 +33,7 @@ public :
typedef typename EOT::Fitness Fitness;
// START eventually add or modify the anyVariable argument
/** Ctor - you change the default name of course.
/** Ctor - you change the default name of course.
* @param
* _description : inherited from eoValueParam (eoStat is an from eoVapueParam)
*/
@ -46,7 +46,7 @@ public :
}
void operator()(const eoPop<EOT>& _pop){
double tmpStat;
double tmpStat(0.);
// START Code for computing the statistics - in tmpStat
// tmpStat = blablabla
// END Code for computing the statistics