fixing makefiles

This commit is contained in:
gustavo 2000-03-30 17:11:20 +00:00
commit 5fe7510807
15 changed files with 153 additions and 307 deletions

View file

@ -5,7 +5,7 @@ AM_INIT_AUTOMAKE(eo)
AC_PROG_CXX AC_PROG_CXX
CXXFLAGS = -Wall -g #CXXFLAGS = -Wall -g
AM_PROG_LIBTOOL AM_PROG_LIBTOOL

View file

@ -28,8 +28,8 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include <stdexcept> // runtime_error #include <stdexcept> // runtime_error
#include <eoObject.h> // #include "eoObject.h" //
#include <eoPersistent.h> // #include "eoPersistent.h" //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** EO is a base class for evolvable objects, that is, the subjects of /** EO is a base class for evolvable objects, that is, the subjects of

View file

@ -27,7 +27,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include <utils/eoData.h> // For limits definition #include "utils/eoData.h" // For limits definition
#include <iostream> // istream, ostream #include <iostream> // istream, ostream
#include <string> // string #include <string> // string

View file

@ -1,397 +1,207 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// eoOp.h // eoOp.h
// (c) GeNeura Team, 1998 // (c) GeNeura Team, 1998
/* /*
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: todos@geneura.ugr.es, http://geneura.ugr.es Contact: todos@geneura.ugr.es, http://geneura.ugr.es
*/ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef _eoOp_H #ifndef _eoOp_H
#define _eoOp_H #define _eoOp_H
#include <eoObject.h> #include <eoObject.h>
#include <eoPrintable.h> #include <eoPrintable.h>
/** @name Genetic operators /** @name Genetic operators
What is a genetic algorithm without genetic operators? There is a genetic operator hierarchy, with eoOp as father and eoMonOp (monary or unary operator) and eoBinOp and eoQuadraticOp (binary operators) as siblings). Nobody should subclass eoOp, you should subclass eoGeneralOp, eoBinOp, eoQuadraticOp or eoMonOp, those are the ones actually used here. \\#eoOp#s are only printable objects, so if you want to build them from a file, it has to be done in another class, namely factories. Each hierarchy of #eoOp#s should have its own factory, which know how to build them from a description in a file.
What is a genetic algorithm without genetic operators? There is a genetic operator hierarchy, with
eoOp as father and eoMonOp (monary or unary operator) and eoBinOp and eoQuadraticOp (binary operators)
as siblings). Nobody should subclass eoOp, you should subclass eoGeneralOp, eoBinOp, eoQuadraticOp or eoMonOp,
those are the ones actually used here.\\
#eoOp#s are only printable objects, so if you want to build them from a file, it has to
be done in another class, namely factories. Each hierarchy of #eoOp#s should have its own
factory, which know how to build them from a description in a file.
@author GeNeura Team @author GeNeura Team
@version 0.1 @version 0.1
@see eoOpFactory @see eoOpFactory
*/ */
/** Abstract data types for EO operators. /** Abstract data types for EO operators.
* Genetic operators act on chromosomes, changing them. The type to
* Genetic operators act on chromosomes, changing them. The type to instantiate them should * instantiate them should be an eoObject, but in any case, they are
* type-specific; each kind of evolvable object can have its own operators
* be an eoObject, but in any case, they are type-specific; each kind of evolvable object
* can have its own operators
*/ */
template<class EOType> template<class EOType>
class eoOp: public eoObject, public eoPrintable { class eoOp: public eoObject, public eoPrintable {
public: public:
//@{ //@{
enum OpType { unary = 0, binary = 1, quadratic = 2, general = 3}; enum OpType { unary = 0, binary = 1, quadratic = 2, general = 3};
/// ///
/// Ctor /// Ctor
eoOp(OpType _type) eoOp(OpType _type)
:opType( _type ) {}; :opType( _type ) {};
/// Copy Ctor /// Copy Ctor
eoOp( const eoOp& _eop ) eoOp( const eoOp& _eop )
:opType( _eop.opType ) {}; :opType( _eop.opType ) {};
/// Needed virtual destructor /// Needed virtual destructor
virtual ~eoOp(){}; virtual ~eoOp(){};
/// getType: number of operands it takes and individuals it produces /// getType: number of operands it takes and individuals it produces
OpType getType() const {return opType;}; OpType getType() const {return opType;};
/** @name Methods from eoObject */ /** @name Methods from eoObject */
//@{ //@{
/** /**
* Write object. It's called printOn since it prints the object _on_ a stream. * Write object. It's called printOn since it prints the object _on_ a stream.
* @param _os A ostream. * @param _os A ostream.
*/ */
virtual void printOn(ostream& _os) const { virtual void printOn(ostream& _os) const {
_os << className(); _os << className();
// _os << arity; // _os << arity;
}; };
/** Inherited from eoObject /** Inherited from eoObject
@see eoObject @see eoObject
*/ */
virtual string className() const {return "eoOp";}; virtual string className() const {return "eoOp";};
//@} //@}
private: private:
/// OpType is the type of the operator: how many operands it takes and how many it produces /// OpType is the type of the operator: how many operands it takes and how many it produces
OpType opType; OpType opType;
}; };
/** Binary genetic operator: subclasses eoOp, and defines /** Binary genetic operator: subclasses eoOp, and defines basically the
* operator() with two operands
basically the operator() with two operands
*/ */
template<class EOType> template<class EOType>
class eoBinOp: public eoOp<EOType> { class eoBinOp: public eoOp<EOType> {
public: public:
/// Ctor /// Ctor
eoBinOp() eoBinOp()
:eoOp<EOType>( binary ) {}; :eoOp<EOType>( binary ) {};
/// Copy Ctor /// Copy Ctor
eoBinOp( const eoBinOp& _ebop ) eoBinOp( const eoBinOp& _ebop )
: eoOp<EOType>( _ebop ){}; : eoOp<EOType>( _ebop ){};
/// Dtor /// Dtor
~eoBinOp () {}; ~eoBinOp () {};
/** applies operator, to the object. Modifies only the first operand. /** applies operator, to the object. Modifies only the first operand.
*/ */
virtual void operator()( EOType& _eo1, const EOType& _eo2 ) const = 0; virtual void operator()( EOType& _eo1, const EOType& _eo2 ) const = 0;
/** @name Methods from eoObject /** @name Methods from eoObject
readFrom and printOn are directly inherited from eoObject readFrom and printOn are directly inherited from eoObject
*/ */
//@{ //@{
/** Inherited from eoObject /** Inherited from eoObject
@see eoObject @see eoObject
*/ */
virtual string className() const {return "eoBinOp";}; virtual string className() const {return "eoBinOp";};
//@} //@}
}; };
/** Quadratic genetic operator: subclasses eoOp, and defines /** Quadratic genetic operator: subclasses eoOp, and defines basically the
operator() with two operands
basically the operator() with two operands
*/ */
template<class EOType> template<class EOType>
class eoQuadraticOp: public eoOp<EOType> { class eoQuadraticOp: public eoOp<EOType> {
public: public:
/// Ctor /// Ctor
eoQuadraticOp() eoQuadraticOp()
:eoOp<EOType>( eoOp<EOType>::quadratic ) {}; :eoOp<EOType>( eoOp<EOType>::quadratic ) {};
/// Copy Ctor /// Copy Ctor
eoQuadraticOp( const eoQuadraticOp& _ebop ) eoQuadraticOp( const eoQuadraticOp& _ebop )
: eoOp<EOType>( _ebop ){}; : eoOp<EOType>( _ebop ){};
/// Dtor /// Dtor
~eoQuadraticOp() {}; ~eoQuadraticOp() {};
/** applies operator, to the object. Modifies both operands. /** applies operator, to the object. Modifies both operands.
*/ */
virtual void operator()( EOType& _eo1, EOType& _eo2 ) const = 0; virtual void operator()( EOType& _eo1, EOType& _eo2 ) const = 0;
/** @name Methods from eoObject /** @name Methods from eoObject
readFrom and printOn are directly inherited from eoObject readFrom and printOn are directly inherited from eoObject
*/ */
//@{ //@{
/** Inherited from eoObject /** Inherited from eoObject
@see eoObject @see eoObject
*/ */
virtual string className() const {return "eoBinOp";}; virtual string className() const {return "eoBinOp";};
//@} //@}
}; };
/** eoMonOp is the monary operator: genetic operator that takes /** eoMonOp is the monary operator: genetic operator that takes only one EO */
only one EO
*/
template <class EOType> template <class EOType>
class eoMonOp: public eoOp<EOType> { class eoMonOp: public eoOp<EOType> {
public: public:
/// Ctor /// Ctor
eoMonOp( ) eoMonOp( )
: eoOp<EOType>( eoOp<EOType>::unary ) {}; : eoOp<EOType>( eoOp<EOType>::unary ) {};
/// Copy Ctor /// Copy Ctor
eoMonOp( const eoMonOp& _emop ) eoMonOp( const eoMonOp& _emop )
: eoOp<EOType>( _emop ){}; : eoOp<EOType>( _emop ){};
/// Dtor /// Dtor
~eoMonOp() {}; ~eoMonOp() {};
/** applies randomly operator, to the object. If arity is more than 1, /** applies randomly operator, to the object. If arity is more than 1,
* keeps a copy of the operand in a cache. * keeps a copy of the operand in a cache.
*/ */
virtual void operator()( EOType& _eo1) const = 0; virtual void operator()( EOType& _eo1) const = 0;
/** @name Methods from eoObject /** @name Methods from eoObject
readFrom and printOn are directly inherited from eoObject readFrom and printOn are directly inherited from eoObject
*/ */
//@{ //@{
/** Inherited from eoObject /** Inherited from eoObject
@see eoObject @see eoObject
*/ */
virtual string className() const {return "eoMonOp";}; virtual string className() const {return "eoMonOp";};
//@} //@}
}; };
@ -403,68 +213,39 @@ template<class EOT>
class eoIndiSelector; class eoIndiSelector;
template<class EOT> template<class EOT>
class eoInserter; class eoInserter;
/** /**
* eGeneralOp: General genetic operator; for objects used to transform sets * eGeneralOp: General genetic operator; for objects used to transform sets
* of EOs. Nary ("orgy") operators should be derived from this class
of EOs. Nary ("orgy") operators should be derived from this class
*/ */
template<class EOT> template<class EOT>
class eoGeneralOp: public eoOp<EOT> class eoGeneralOp: public eoOp<EOT>
{ {
public: public:
/// Ctor that honors its superclass /// Ctor that honors its superclass
eoGeneralOp(): eoOp<EOT>( eoOp<EOT>::general ) {}
eoGeneralOp(): eoOp<EOT>( eoOp<EOT>::general ) {};
/// Virtual dtor /// Virtual dtor
virtual ~eoGeneralOp () {}
virtual ~eoGeneralOp () {};
/** Method that really does the stuff. Applies the genetic operator /** Method that really does the stuff. Applies the genetic operator
to a individuals dispensed by an eoIndividualSelector, to a individuals dispensed by an eoIndividualSelector,
and puts the results in the eoIndividualInserter. and puts the results in the eoIndividualInserter.
Any number of inputs can be requested and any number of outputs Any number of inputs can be requested and any number of outputs
can be produced. can be produced.
*/ */
virtual void operator()( eoIndiSelector<EOT>& _in, virtual void operator()( eoIndiSelector<EOT>& _in,
eoInserter<EOT>& _out) const = 0; eoInserter<EOT>& _out) const = 0;
virtual string className() const {return "eoGeneralOp";}
virtual string className() const {return "eoGeneralOp";};
}; };
#endif #endif

View file

@ -40,7 +40,7 @@ const unsigned MAXLINELENGTH=1024;
#include <string> // para string #include <string> // para string
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include <eoPrintable.h> #include "eoPrintable.h"
using namespace std; using namespace std;

8
eo/src/es/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
###############################################################################
##
## Makefile.am for eo/src/es
##
###############################################################################
libeoincdir = $(includedir)/eo/es
libeoinc_HEADERS = eoESFullChrom.h eoESChrom.h eoESFullMut.h

8
eo/src/ga/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
###############################################################################
##
## Makefile.am for eo/src/ga
##
###############################################################################
libeoincdir = $(includedir)/eo/ga
libeoinc_HEADERS = eoBin.h eoBitOp.h eoBitOpFactory.h

8
eo/src/gp/Makefile.am Normal file
View file

@ -0,0 +1,8 @@
###############################################################################
##
## Makefile.am for eo/src/gp
##
###############################################################################
libeoincdir = $(includedir)/eo/gp
libeoinc_HEADERS = eoParseTree.h node_pool.h parse_tree.h

View file

@ -0,0 +1,13 @@
###############################################################################
##
## Makefile.am for eo/src/obsolete
##
###############################################################################
INCLUDES = -I$(top_builddir)/src
lib_LIBRARIES = libeoobsolete.a
libeoobsolete_a_SOURCES = eoParserUtils.cpp
libeoobsoleteincdir = $(includedir)/eo/obsolete
libeoobsoleteinc_HEADERS = eoProblem.h eoParser.h eoParserUtils.h

View file

@ -14,8 +14,8 @@ Modifications.:
#ifndef EO_PARSER_UTILS #ifndef EO_PARSER_UTILS
#define EO_PARSER_UTILS #define EO_PARSER_UTILS
#include <utils/eoRNG.h> #include "../utils/eoRNG.h"
#include <eoParser.h> #include "eoParser.h"
/// Reproducible random seed /// Reproducible random seed
//---------------------------------- //----------------------------------

13
eo/src/other/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
###############################################################################
##
## Makefile.am for eo/src/other
##
###############################################################################
INCLUDES = -I$(top_builddir)/src
lib_LIBRARIES = libeoother.a
libeoother_a_SOURCES = eoExternalOpFunctions.cpp
libeootherincdir = $(includedir)/eo/other
libeootherinc_HEADERS = eoExternalEO.h eoString.h eoStringMutation.h

View file

@ -50,7 +50,7 @@ class eoExternalEO : public EO, virtual public External
virtual void readFrom(istream& _is) virtual void readFrom(istream& _is)
{ {
EO::readFrom(is); EO::readFrom(is);
throw runtime_excpetion("Reading not defined yet"); throw runtime_exception("Reading not defined yet");
} }
/** /**

View file

@ -28,9 +28,9 @@
#ifndef eoExternalOpFunc_h #ifndef eoExternalOpFunc_h
#define eoExternalOpFunc_h #define eoExternalOpFunc_h
#include "eoExternalEO.h" #include <eoExternalEO.h>
#include "eoOps.h" #include <eoOp.h>
#include "eoRnd.h" #include <utils/eoRNG.h>
template <class F, class External> template <class F, class External>
class eoExternalInitFunc class eoExternalInitFunc
@ -39,3 +39,5 @@ class eoExternalInitFunc
public : public :
}; };
#endif

13
eo/src/utils/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
###############################################################################
##
## Makefile.am for eo/src/utils
##
###############################################################################
INCLUDES = -I$(top_builddir)/src
lib_LIBRARIES = libeoutils.a
libeoutils_a_SOURCES = eoParser.cpp eoRNG.cpp eoState.cpp
libeoincdir = $(includedir)/eo/utils
libeoinc_HEADERS = compatibility.h eoParam.h eoRNG.h rnd_generators.h eoData.h eoParser.h eoState.h selectors.h

View file

@ -82,8 +82,8 @@
#define EO_RANDOM_NUMBER_GENERATOR #define EO_RANDOM_NUMBER_GENERATOR
#include <eoPersistent.h> #include "../eoPersistent.h"
#include <eoObject.h> #include "../eoObject.h"
// TODO: check for various compilers if this is exactly 32 bits // TODO: check for various compilers if this is exactly 32 bits
// Unfortunately MSVC's preprocessor does not comprehends sizeof() // Unfortunately MSVC's preprocessor does not comprehends sizeof()