From 759dba7ea83f1f9e6d09e40fe98c83cbdb5bf366 Mon Sep 17 00:00:00 2001 From: jmerelo Date: Mon, 20 Sep 1999 11:35:01 +0000 Subject: [PATCH] Changes to eo1d interface and bug fixes --- eo/src/EO.h | 17 ++++ eo/src/eo | 18 ++++ eo/src/eo1d.h | 40 ++++++--- eo/src/eoAged.h | 18 ++++ eo/src/eoBin.h | 8 +- eo/src/eoBitOpFactory.h | 18 ++++ eo/src/eoDrawable.h | 17 ++++ eo/src/eoDup.h | 18 ++++ eo/src/eoESChrom.h | 17 ++++ eo/src/eoEvalFunc.h | 17 ++++ eo/src/eoEvaluator.h | 17 ++++ eo/src/eoFactory.h | 17 ++++ eo/src/eoFitness.h | 18 ++++ eo/src/eoID.h | 17 ++++ eo/src/eoInsertion.h | 2 +- eo/src/eoKill.h | 17 ++++ eo/src/eoMultiMonOp.h | 17 ++++ eo/src/eoMutation.h | 17 ++++ eo/src/eoNegExp.h | 17 ++++ eo/src/eoNormal.h | 17 ++++ eo/src/eoObject.h | 17 ++++ eo/src/eoOp.h | 17 ++++ eo/src/eoOpFactory.h | 18 ++++ eo/src/eoOpSelMason.h | 17 ++++ eo/src/eoOpSelector.h | 19 +++- eo/src/eoPersistent.h | 17 ++++ eo/src/eoPop.h | 17 ++++ eo/src/eoPopOps.h | 18 ++++ eo/src/eoPrintable.h | 17 ++++ eo/src/eoProblem.h | 17 ++++ eo/src/eoProportionalOpSel.h | 19 +++- eo/src/eoRandomBreed.h | 17 ++++ eo/src/eoRandomSelect.h | 17 ++++ eo/src/eoRank.h | 17 ++++ eo/src/eoRnd.h | 17 ++++ eo/src/eoSelectFactory.h | 18 ++++ eo/src/eoSimpleEval.h | 17 ++++ eo/src/eoString.h | 17 ++++ eo/src/eoTournament.h | 17 ++++ eo/src/eoTranspose.h | 17 ++++ eo/src/eoUniform.h | 18 ++++ eo/src/eoVector.h | 25 +++++- eo/src/eoXOver2.h | 17 ++++ eo/test/Makefile.in | 166 +---------------------------------- eo/test/t-eobreeder.cpp | 45 +++++----- eo/test/t-eoinclusion.cpp | 4 +- eo/test/t-eoproblem.cpp | 3 +- 47 files changed, 762 insertions(+), 207 deletions(-) diff --git a/eo/src/EO.h b/eo/src/EO.h index 9ace34bc..233746bc 100644 --- a/eo/src/EO.h +++ b/eo/src/EO.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // EO.h // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EO_H diff --git a/eo/src/eo b/eo/src/eo index 26d58a98..75e0716d 100644 --- a/eo/src/eo +++ b/eo/src/eo @@ -1,6 +1,23 @@ //----------------------------------------------------------------------------- // eo // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _eo_ @@ -12,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/eo/src/eo1d.h b/eo/src/eo1d.h index c33d7cb6..956d8a6f 100644 --- a/eo/src/eo1d.h +++ b/eo/src/eo1d.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eo1d.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EO1D_H @@ -16,7 +33,7 @@ using namespace std; -/** @name EO1d class +/** @name eo1d class * Randomly accesible evolvable object with one dimension, with variable length. * Use this if you want to evolve "linear" things, like bitstrings, or @@ -52,8 +69,9 @@ public: */ eo1d( unsigned _size, eoRnd& _rndGen, const string& _ID = ""); - /** Ctor from a istream. It just passes the stream to EO. - @param _is the input stream; eo1d just cares about the fitness + /** Ctor from a istream. It just passes the stream to EO, subclasses should + have to implement this. + @param _is the input stream */ eo1d( istream& _is): EO( _is ){}; @@ -77,7 +95,7 @@ public: @return what's inside the gene, with the correct type @exception out_of_range if _i > size() */ - virtual T gene( unsigned _i ) const = 0; + virtual T getGene( unsigned _i ) const = 0; /** Overwrites the gene placed in position _i with a * new value. This means that the assignment operator @@ -86,7 +104,7 @@ public: @return what's inside the gene, with the correct type @exception out_of_range if _i > size() */ - virtual T& gene( unsigned _i ) = 0; + virtual void setGene( unsigned _i, const T& _value ) = 0; /** Inserts a gene, moving the rest to the right. If * _i = length(), it should insert it at the end. @@ -116,19 +134,21 @@ public: virtual void readFrom(istream& _s) { for ( unsigned i = 0; i < length(); i ++ ) { - _s >> gene( i ); + T tmp; + _s >> tmp; + setGene( i, tmp ); } // there is no way of distinguishing fitness from the object, so // it's skipped } - /** Print itself: inherited from eoObject implementation. Declared virtual so that - it can be reimplemented anywhere. Instance from base classes are processed in - base classes, so you donīt have to worry about, for instance, fitness. + /** Print itself: inherited from eoObject implementation. + Instance from base classes are processed in + base classes, so you donīt have to worry about, for instance, fitness. @param _s the ostream in which things are written*/ virtual void printOn( ostream& _s ) const{ for ( unsigned i = 0; i < length(); i ++ ) { - _s << gene( i ) << " "; + _s << getGene( i ) << " "; } } diff --git a/eo/src/eoAged.h b/eo/src/eoAged.h index a044688f..7c626e01 100644 --- a/eo/src/eoAged.h +++ b/eo/src/eoAged.h @@ -1,8 +1,26 @@ +// eoAged.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eoAge.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOAGED_H diff --git a/eo/src/eoBin.h b/eo/src/eoBin.h index e1a1c021..b78cff47 100644 --- a/eo/src/eoBin.h +++ b/eo/src/eoBin.h @@ -25,20 +25,20 @@ template class eoBin: public eoVector * (Default) Constructor. * @param size Size of the binary string. */ - eoBin(const unsigned& size = 0, const bool& value = false): + eoBin(unsigned size = 0, bool value = false): eoVector(size, value) {} /** * Constructor. * @param size Size of the binary string. */ - eoBin(const unsigned& size, const eoRnd& rnd): eoVector(size) + eoBin(unsigned size, const eoRnd& rnd): eoVector(size) { generate(begin(), end(), rnd); } - /// Constructor from istream. - /// @param is The istream to read from. + /** Constructor from istream. + @param is The istream to read from.*/ eoBin(istream& _is):eoVector(_is){}; /// My class name. diff --git a/eo/src/eoBitOpFactory.h b/eo/src/eoBitOpFactory.h index 2ca12d75..b47b6459 100644 --- a/eo/src/eoBitOpFactory.h +++ b/eo/src/eoBitOpFactory.h @@ -1,8 +1,26 @@ +// eoBitOpFactory.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eoOpFactory.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOBITOPFACTORY_H diff --git a/eo/src/eoDrawable.h b/eo/src/eoDrawable.h index 72885dca..221bf2c1 100644 --- a/eo/src/eoDrawable.h +++ b/eo/src/eoDrawable.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoDrawable.h // (c) GeNeura Team, 1999 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EODRAWABLE_H diff --git a/eo/src/eoDup.h b/eo/src/eoDup.h index be1f68c9..ade6c248 100644 --- a/eo/src/eoDup.h +++ b/eo/src/eoDup.h @@ -1,8 +1,26 @@ +// eoDup.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eoKill.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EODUP_h diff --git a/eo/src/eoESChrom.h b/eo/src/eoESChrom.h index 04a2e6d4..b5a66a4e 100644 --- a/eo/src/eoESChrom.h +++ b/eo/src/eoESChrom.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoESChrom.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- diff --git a/eo/src/eoEvalFunc.h b/eo/src/eoEvalFunc.h index 76043898..1d6f9819 100644 --- a/eo/src/eoEvalFunc.h +++ b/eo/src/eoEvalFunc.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoEvalFunc.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef eoEvalFunc_H diff --git a/eo/src/eoEvaluator.h b/eo/src/eoEvaluator.h index 53e3e083..1e03b604 100644 --- a/eo/src/eoEvaluator.h +++ b/eo/src/eoEvaluator.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoEvaluator.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOEVALUATOR_H diff --git a/eo/src/eoFactory.h b/eo/src/eoFactory.h index ded9ab4c..05f9f8a4 100644 --- a/eo/src/eoFactory.h +++ b/eo/src/eoFactory.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoFactory.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOFACTORY_H diff --git a/eo/src/eoFitness.h b/eo/src/eoFitness.h index c7d87c9c..8696f496 100644 --- a/eo/src/eoFitness.h +++ b/eo/src/eoFitness.h @@ -1,6 +1,24 @@ +// eoFitness.h //----------------------------------------------------------------------------- // eoFitness.cpp // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOFITNESS_H diff --git a/eo/src/eoID.h b/eo/src/eoID.h index 61f142f1..7488d26b 100644 --- a/eo/src/eoID.h +++ b/eo/src/eoID.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoID.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOID_H diff --git a/eo/src/eoInsertion.h b/eo/src/eoInsertion.h index 7d8507e1..994645e1 100644 --- a/eo/src/eoInsertion.h +++ b/eo/src/eoInsertion.h @@ -19,7 +19,7 @@ template class eoInsertion: public eoMerge { public: /// (Default) Constructor. - eoInsertion(const float& _rate = 1.0): eoMerge(_rate) {} + eoInsertion(const float& _rate = 1.0): eoMerge(_rate) {} /** * Creates a new population based on breeders and original populations. diff --git a/eo/src/eoKill.h b/eo/src/eoKill.h index 7810d6e0..bddcbb2b 100644 --- a/eo/src/eoKill.h +++ b/eo/src/eoKill.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoKill.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOKILL_h diff --git a/eo/src/eoMultiMonOp.h b/eo/src/eoMultiMonOp.h index e44931b5..c46f8777 100644 --- a/eo/src/eoMultiMonOp.h +++ b/eo/src/eoMultiMonOp.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoMultiMonOp.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOMULTIMONOP_h diff --git a/eo/src/eoMutation.h b/eo/src/eoMutation.h index 82c9c64e..466c377e 100644 --- a/eo/src/eoMutation.h +++ b/eo/src/eoMutation.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoMutation.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOMUTATION_H #define _EOMUTATION_H diff --git a/eo/src/eoNegExp.h b/eo/src/eoNegExp.h index db4f5836..54812ed2 100644 --- a/eo/src/eoNegExp.h +++ b/eo/src/eoNegExp.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoNegExp.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EONEGEXP_H diff --git a/eo/src/eoNormal.h b/eo/src/eoNormal.h index a75adef9..c0691673 100644 --- a/eo/src/eoNormal.h +++ b/eo/src/eoNormal.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoNormal.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EONORMAL_H diff --git a/eo/src/eoObject.h b/eo/src/eoObject.h index 7cd3365c..56a746b5 100644 --- a/eo/src/eoObject.h +++ b/eo/src/eoObject.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoObject.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOOBJECT_H diff --git a/eo/src/eoOp.h b/eo/src/eoOp.h index ac702761..2b0b13e3 100644 --- a/eo/src/eoOp.h +++ b/eo/src/eoOp.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoOp.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _eoOp_H diff --git a/eo/src/eoOpFactory.h b/eo/src/eoOpFactory.h index 9ffe402b..f4182acd 100644 --- a/eo/src/eoOpFactory.h +++ b/eo/src/eoOpFactory.h @@ -1,8 +1,26 @@ +// eoOpFactory.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eoMonOpFactory.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOOPFACTORY_H diff --git a/eo/src/eoOpSelMason.h b/eo/src/eoOpSelMason.h index d8fb0722..3f96d822 100644 --- a/eo/src/eoOpSelMason.h +++ b/eo/src/eoOpSelMason.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoOpSelMason.h // (c) GeNeura Team, 1999 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOOPSELMASON_H diff --git a/eo/src/eoOpSelector.h b/eo/src/eoOpSelector.h index 717071c3..2ee11205 100644 --- a/eo/src/eoOpSelector.h +++ b/eo/src/eoOpSelector.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoOpSelector.h // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOOPSELECTOR_H @@ -44,7 +61,7 @@ public: @param _id a previously assigned ID @throw runtime_exception if the ID does not exist */ - virtual deleteOp( ID _id ) = 0; + virtual void deleteOp( ID _id ) = 0; /// Returns a genetic operator according to the established criteria virtual eoOp* Op() = 0; diff --git a/eo/src/eoPersistent.h b/eo/src/eoPersistent.h index 96413412..1fe0acdf 100644 --- a/eo/src/eoPersistent.h +++ b/eo/src/eoPersistent.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoPersistent.h // (c) GeNeura Team, 1999 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOPERSISTENT_H diff --git a/eo/src/eoPop.h b/eo/src/eoPop.h index cc2edf25..bd1c3390 100644 --- a/eo/src/eoPop.h +++ b/eo/src/eoPop.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoPop.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOPOP_H diff --git a/eo/src/eoPopOps.h b/eo/src/eoPopOps.h index f97e7899..7ece0de6 100644 --- a/eo/src/eoPopOps.h +++ b/eo/src/eoPopOps.h @@ -1,8 +1,26 @@ +// eoPopOps.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // eo1d.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOPOPOPS_H diff --git a/eo/src/eoPrintable.h b/eo/src/eoPrintable.h index f2c25a24..dc761ebf 100644 --- a/eo/src/eoPrintable.h +++ b/eo/src/eoPrintable.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoPrintable.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOPRINTABLE_H diff --git a/eo/src/eoProblem.h b/eo/src/eoProblem.h index a1f5e7b6..c8ab4044 100644 --- a/eo/src/eoProblem.h +++ b/eo/src/eoProblem.h @@ -1,6 +1,23 @@ //----------------------------------------------------------------------------- // eoProblem.h // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOPROBLEM_H diff --git a/eo/src/eoProportionalOpSel.h b/eo/src/eoProportionalOpSel.h index ba255696..0e4d93ad 100644 --- a/eo/src/eoProportionalOpSel.h +++ b/eo/src/eoProportionalOpSel.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoProportionalOpSel.h // (c) GeNeura Team 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EOPROPORTIONALOPSEL_H @@ -67,7 +84,7 @@ public: @param _id a previously assigned ID @throw runtime_error if the ID does not exist */ - virtual deleteOp( ID _id ) { + virtual void deleteOp( ID _id ) { unsigned j; MMF::iterator i; for ( i=begin(), j=1; i!=end(); i++,j++ ) { diff --git a/eo/src/eoRandomBreed.h b/eo/src/eoRandomBreed.h index a0faa0f1..dd22d843 100644 --- a/eo/src/eoRandomBreed.h +++ b/eo/src/eoRandomBreed.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoRandomBreed.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EORANDOMBREED_H diff --git a/eo/src/eoRandomSelect.h b/eo/src/eoRandomSelect.h index 9b6ad0bc..651174e8 100644 --- a/eo/src/eoRandomSelect.h +++ b/eo/src/eoRandomSelect.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoRandomSelect.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef EORANDOMSELECT_H diff --git a/eo/src/eoRank.h b/eo/src/eoRank.h index db441dd5..adc3ff83 100644 --- a/eo/src/eoRank.h +++ b/eo/src/eoRank.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoRank.h // (c) GeNeura Team 1999 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _eoRank_H diff --git a/eo/src/eoRnd.h b/eo/src/eoRnd.h index ef4c2328..84a4a66a 100644 --- a/eo/src/eoRnd.h +++ b/eo/src/eoRnd.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoRnd.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EORND_H diff --git a/eo/src/eoSelectFactory.h b/eo/src/eoSelectFactory.h index 2169bef2..1d83f5f4 100644 --- a/eo/src/eoSelectFactory.h +++ b/eo/src/eoSelectFactory.h @@ -1,8 +1,26 @@ +// eoSelectFactory.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // EOFactory.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOSELECTFACTORY_H diff --git a/eo/src/eoSimpleEval.h b/eo/src/eoSimpleEval.h index 5a1e895f..40e735c6 100644 --- a/eo/src/eoSimpleEval.h +++ b/eo/src/eoSimpleEval.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoSimpleEval.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOSimpleEval_H diff --git a/eo/src/eoString.h b/eo/src/eoString.h index fc4c84f4..f2e60f45 100644 --- a/eo/src/eoString.h +++ b/eo/src/eoString.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoString.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _eoString_H diff --git a/eo/src/eoTournament.h b/eo/src/eoTournament.h index 29b89064..c71e16ad 100644 --- a/eo/src/eoTournament.h +++ b/eo/src/eoTournament.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoTournament.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOGSTOURN_H diff --git a/eo/src/eoTranspose.h b/eo/src/eoTranspose.h index bafd03f1..2987fca0 100644 --- a/eo/src/eoTranspose.h +++ b/eo/src/eoTranspose.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoTranspose.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOTRANSPOSE_h diff --git a/eo/src/eoUniform.h b/eo/src/eoUniform.h index d53ec967..eec13ac4 100644 --- a/eo/src/eoUniform.h +++ b/eo/src/eoUniform.h @@ -1,8 +1,26 @@ +// eoUniform.h // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- //----------------------------------------------------------------------------- // EOUniform.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOUNIFORM_H diff --git a/eo/src/eoVector.h b/eo/src/eoVector.h index a70723b7..f116608c 100644 --- a/eo/src/eoVector.h +++ b/eo/src/eoVector.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoVector.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- @@ -24,7 +41,7 @@ template class eoVector: public eo1d, public vector { public: - typedef Type T; + typedef T Type ; /// Canonical part of the objects: several ctors, copy ctor, dtor and assignment operator //@{ @@ -70,7 +87,7 @@ which is supposed to be dynamic and dependent on environment. /** methods that implement the eo1d protocol @exception out_of_range if _i is larger than EOīs size */ - virtual T gene( unsigned _i ) const { + virtual T getGene( unsigned _i ) const { if ( _i >= length() ) throw out_of_range( "out_of_range when reading gene"); return (*this)[_i]; @@ -79,10 +96,10 @@ which is supposed to be dynamic and dependent on environment. /** methods that implement the eo1d protocol @exception out_of_range if _i is larger than EOīs size */ - virtual T& gene( unsigned _i ) { + virtual void setGene( unsigned _i, const T& _value ) { if ( _i >= size() ) throw out_of_range( "out_of_range when writing a gene"); - return operator[](_i); + (*this)[_i] = _value; }; /** methods that implement the eo1d protocol diff --git a/eo/src/eoXOver2.h b/eo/src/eoXOver2.h index 8f70e030..9361f91e 100644 --- a/eo/src/eoXOver2.h +++ b/eo/src/eoXOver2.h @@ -3,6 +3,23 @@ //----------------------------------------------------------------------------- // eoXOver2.h // (c) GeNeura Team, 1998 +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Contact: todos@geneura.ugr.es, http://geneura.ugr.es + */ //----------------------------------------------------------------------------- #ifndef _EOXOVER2_h diff --git a/eo/test/Makefile.in b/eo/test/Makefile.in index 4e4daa16..12163120 100644 --- a/eo/test/Makefile.in +++ b/eo/test/Makefile.in @@ -87,7 +87,7 @@ LDADDS = $(top_builddir)/src/libeo.a ############################################################################### -noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t_eornd t_eovector t_eoaged t_eoid t_eostring t_ops t_popops t_pop t_es t_opsel t_opfactory t_opMut t_eobitfact +noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery ############################################################################### @@ -139,82 +139,6 @@ t_eolottery_SOURCES = t-eolottery.cpp t_eolottery_DEPENDENCIES = $(DEPS) t_eovector_LDFLAGS = -lm t_eolottery_LDADD = $(LDADDS) - -############################################################################### - -t_eornd_SOURCES = t_eornd.cpp -t_eornd_LDFLAGS = -lm - -############################################################################### - -t_eovector_SOURCES = t_eovector.cpp -t_eovector_LDADD = $(LDADDS) - -############################################################################### - -t_eoaged_SOURCES = t_eoaged.cpp -t_eoaged_DEPENDENCIES = $(DEPS) -t_eoaged_LDADD = $(LDADDS) - -############################################################################### - -t_eoid_SOURCES = t_eoid.cpp -t_eoid_DEPENDENCIES = $(DEPS) -t_eoid_LDADD = $(LDADDS) - -############################################################################### - -t_eostring_SOURCES = t_eostring.cpp -t_eostring_DEPENDENCIES = $(DEPS) -t_eostring_LDADD = $(LDADDS) - -############################################################################### - -t_es_SOURCES = t_es.cpp -t_es_DEPENDENCIES = $(DEPS) -t_es_LDADD = $(LDADDS) - -############################################################################### - -t_ops_SOURCES = t_ops.cpp -t_ops_DEPENDENCIES = $(DEPS) -t_ops_LDADD = $(LDADDS) - -############################################################################### - -t_pop_SOURCES = t_pop.cpp -t_pop_DEPENDENCIES = $(DEPS) -t_pop_LDADD = $(LDADDS) - -############################################################################### - -t_popops_SOURCES = t_popops.cpp -t_popops_DEPENDENCIES = $(DEPS) -t_popops_LDADD = $(LDADDS) - -############################################################################### - -t_opsel_SOURCES = t_opsel.cpp -t_opsel_DEPENDENCIES = $(DEPS) -t_opsel_LDADD = $(LDADDS) - -############################################################################### - -t_opfactory_SOURCES = t_opfactory.cpp -t_opfactory_DEPENDENCIES = $(DEPS) -t_opfactory_LDADD = $(LDADDS) - -############################################################################### - -t_opMut_SOURCES = t_opMut.cpp -t_opMut_DEPENDENCIES = $(DEPS) -t_opMut_LDADD = $(LDADDS) - -############################################################################### - -t_eobitfact_SOURCES = t_eobitfact.cpp -t_eobitfact_DEPENDENCIES = $(DEPS) -t_eobitfact_LDADD = $(LDADDS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) @@ -238,33 +162,6 @@ t_eobin_OBJECTS = t-eobin.o t_eobin_LDFLAGS = t_eolottery_OBJECTS = t-eolottery.o t_eolottery_LDFLAGS = -t_eornd_OBJECTS = t_eornd.o -t_eornd_LDADD = $(LDADD) -t_eornd_DEPENDENCIES = -t_eovector_OBJECTS = t_eovector.o -t_eovector_DEPENDENCIES = $(top_builddir)/src/libeo.a -t_eoaged_OBJECTS = t_eoaged.o -t_eoaged_LDFLAGS = -t_eoid_OBJECTS = t_eoid.o -t_eoid_LDFLAGS = -t_eostring_OBJECTS = t_eostring.o -t_eostring_LDFLAGS = -t_ops_OBJECTS = t_ops.o -t_ops_LDFLAGS = -t_popops_OBJECTS = t_popops.o -t_popops_LDFLAGS = -t_pop_OBJECTS = t_pop.o -t_pop_LDFLAGS = -t_es_OBJECTS = t_es.o -t_es_LDFLAGS = -t_opsel_OBJECTS = t_opsel.o -t_opsel_LDFLAGS = -t_opfactory_OBJECTS = t_opfactory.o -t_opfactory_LDFLAGS = -t_opMut_OBJECTS = t_opMut.o -t_opMut_LDFLAGS = -t_eobitfact_OBJECTS = t_eobitfact.o -t_eobitfact_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -279,12 +176,9 @@ TAR = gtar GZIP_ENV = --best DEP_FILES = .deps/t-eo.P .deps/t-eobin.P .deps/t-eobreeder.P \ .deps/t-eofitness.P .deps/t-eoinclusion.P .deps/t-eoinsertion.P \ -.deps/t-eolottery.P .deps/t-eoproblem.P .deps/t_eoaged.P \ -.deps/t_eobitfact.P .deps/t_eoid.P .deps/t_eornd.P .deps/t_eostring.P \ -.deps/t_eovector.P .deps/t_es.P .deps/t_opMut.P .deps/t_opfactory.P \ -.deps/t_ops.P .deps/t_opsel.P .deps/t_pop.P .deps/t_popops.P -SOURCES = $(t_eobreeder_SOURCES) $(t_eoinclusion_SOURCES) $(t_eoinsertion_SOURCES) $(t_eo_SOURCES) $(t_eofitness_SOURCES) $(t_eoproblem_SOURCES) $(t_eobin_SOURCES) $(t_eolottery_SOURCES) $(t_eornd_SOURCES) $(t_eovector_SOURCES) $(t_eoaged_SOURCES) $(t_eoid_SOURCES) $(t_eostring_SOURCES) $(t_ops_SOURCES) $(t_popops_SOURCES) $(t_pop_SOURCES) $(t_es_SOURCES) $(t_opsel_SOURCES) $(t_opfactory_SOURCES) $(t_opMut_SOURCES) $(t_eobitfact_SOURCES) -OBJECTS = $(t_eobreeder_OBJECTS) $(t_eoinclusion_OBJECTS) $(t_eoinsertion_OBJECTS) $(t_eo_OBJECTS) $(t_eofitness_OBJECTS) $(t_eoproblem_OBJECTS) $(t_eobin_OBJECTS) $(t_eolottery_OBJECTS) $(t_eornd_OBJECTS) $(t_eovector_OBJECTS) $(t_eoaged_OBJECTS) $(t_eoid_OBJECTS) $(t_eostring_OBJECTS) $(t_ops_OBJECTS) $(t_popops_OBJECTS) $(t_pop_OBJECTS) $(t_es_OBJECTS) $(t_opsel_OBJECTS) $(t_opfactory_OBJECTS) $(t_opMut_OBJECTS) $(t_eobitfact_OBJECTS) +.deps/t-eolottery.P .deps/t-eoproblem.P +SOURCES = $(t_eobreeder_SOURCES) $(t_eoinclusion_SOURCES) $(t_eoinsertion_SOURCES) $(t_eo_SOURCES) $(t_eofitness_SOURCES) $(t_eoproblem_SOURCES) $(t_eobin_SOURCES) $(t_eolottery_SOURCES) +OBJECTS = $(t_eobreeder_OBJECTS) $(t_eoinclusion_OBJECTS) $(t_eoinsertion_OBJECTS) $(t_eo_OBJECTS) $(t_eofitness_OBJECTS) $(t_eoproblem_OBJECTS) $(t_eobin_OBJECTS) $(t_eolottery_OBJECTS) all: all-redirect .SUFFIXES: @@ -369,58 +263,6 @@ t-eobin: $(t_eobin_OBJECTS) $(t_eobin_DEPENDENCIES) t-eolottery: $(t_eolottery_OBJECTS) $(t_eolottery_DEPENDENCIES) @rm -f t-eolottery $(CXXLINK) $(t_eolottery_LDFLAGS) $(t_eolottery_OBJECTS) $(t_eolottery_LDADD) $(LIBS) - -t_eornd: $(t_eornd_OBJECTS) $(t_eornd_DEPENDENCIES) - @rm -f t_eornd - $(CXXLINK) $(t_eornd_LDFLAGS) $(t_eornd_OBJECTS) $(t_eornd_LDADD) $(LIBS) - -t_eovector: $(t_eovector_OBJECTS) $(t_eovector_DEPENDENCIES) - @rm -f t_eovector - $(CXXLINK) $(t_eovector_LDFLAGS) $(t_eovector_OBJECTS) $(t_eovector_LDADD) $(LIBS) - -t_eoaged: $(t_eoaged_OBJECTS) $(t_eoaged_DEPENDENCIES) - @rm -f t_eoaged - $(CXXLINK) $(t_eoaged_LDFLAGS) $(t_eoaged_OBJECTS) $(t_eoaged_LDADD) $(LIBS) - -t_eoid: $(t_eoid_OBJECTS) $(t_eoid_DEPENDENCIES) - @rm -f t_eoid - $(CXXLINK) $(t_eoid_LDFLAGS) $(t_eoid_OBJECTS) $(t_eoid_LDADD) $(LIBS) - -t_eostring: $(t_eostring_OBJECTS) $(t_eostring_DEPENDENCIES) - @rm -f t_eostring - $(CXXLINK) $(t_eostring_LDFLAGS) $(t_eostring_OBJECTS) $(t_eostring_LDADD) $(LIBS) - -t_ops: $(t_ops_OBJECTS) $(t_ops_DEPENDENCIES) - @rm -f t_ops - $(CXXLINK) $(t_ops_LDFLAGS) $(t_ops_OBJECTS) $(t_ops_LDADD) $(LIBS) - -t_popops: $(t_popops_OBJECTS) $(t_popops_DEPENDENCIES) - @rm -f t_popops - $(CXXLINK) $(t_popops_LDFLAGS) $(t_popops_OBJECTS) $(t_popops_LDADD) $(LIBS) - -t_pop: $(t_pop_OBJECTS) $(t_pop_DEPENDENCIES) - @rm -f t_pop - $(CXXLINK) $(t_pop_LDFLAGS) $(t_pop_OBJECTS) $(t_pop_LDADD) $(LIBS) - -t_es: $(t_es_OBJECTS) $(t_es_DEPENDENCIES) - @rm -f t_es - $(CXXLINK) $(t_es_LDFLAGS) $(t_es_OBJECTS) $(t_es_LDADD) $(LIBS) - -t_opsel: $(t_opsel_OBJECTS) $(t_opsel_DEPENDENCIES) - @rm -f t_opsel - $(CXXLINK) $(t_opsel_LDFLAGS) $(t_opsel_OBJECTS) $(t_opsel_LDADD) $(LIBS) - -t_opfactory: $(t_opfactory_OBJECTS) $(t_opfactory_DEPENDENCIES) - @rm -f t_opfactory - $(CXXLINK) $(t_opfactory_LDFLAGS) $(t_opfactory_OBJECTS) $(t_opfactory_LDADD) $(LIBS) - -t_opMut: $(t_opMut_OBJECTS) $(t_opMut_DEPENDENCIES) - @rm -f t_opMut - $(CXXLINK) $(t_opMut_LDFLAGS) $(t_opMut_OBJECTS) $(t_opMut_LDADD) $(LIBS) - -t_eobitfact: $(t_eobitfact_OBJECTS) $(t_eobitfact_DEPENDENCIES) - @rm -f t_eobitfact - $(CXXLINK) $(t_eobitfact_LDFLAGS) $(t_eobitfact_OBJECTS) $(t_eobitfact_LDADD) $(LIBS) .cpp.o: $(CXXCOMPILE) -c $< .cpp.lo: diff --git a/eo/test/t-eobreeder.cpp b/eo/test/t-eobreeder.cpp index dcb01628..11e8ffb6 100644 --- a/eo/test/t-eobreeder.cpp +++ b/eo/test/t-eobreeder.cpp @@ -1,10 +1,15 @@ //----------------------------------------------------------------------------- // t-eobreeder.cpp //----------------------------------------------------------------------------- + +// to avoid long name warnings +#pragma warning(disable:4786) -#include // srand -#include // time -#include // eoBin, eoPop, eoBreeder +#include // eoBin, eoPop, eoBreeder +#include +#include +#include +#include //----------------------------------------------------------------------------- @@ -25,14 +30,12 @@ void binary_value(Chrom& chrom) main() { - srand(time(NULL)); - const unsigned POP_SIZE = 8, CHROM_SIZE = 4; unsigned i; eoUniform uniform(false, true); eoBinRandom random; - eoPop pop, pop2; + eoPop pop; for (i = 0; i < POP_SIZE; i++) { @@ -42,22 +45,22 @@ main() pop.push_back(chrom); } - eoBinBitFlip bitflip; - eoBinCrossover xover; - eoBreeder breeder; - breeder.add(bitflip, 1.0); - breeder.add(xover, 1.0); - - pop2 = pop; - breeder(pop2); - - for (i = 0; i < pop2.size(); i++) - binary_value(pop2[i]); - - cout << "population: \tnew population" << endl; + cout << "population:" << endl; for (i = 0; i < pop.size(); i++) - cout << pop[i] << " " << pop[i].fitness() << " \t" - << pop2[i] << " " << pop2[i].fitness() << endl; + cout << pop[i] << " " << pop[i].fitness() << endl; + + eoBinBitFlip bitflip; + eoBinCrossover xover; + eoProportionalOpSel propSel; + eoBreeder breeder( propSel ); + propSel.addOp(bitflip, 0.25); + propSel.addOp(xover, 0.75); + + breeder(pop); + + cout << "new population:" << endl; + for (i = 0; i < pop.size(); i++) + cout << pop[i] << " " << pop[i].fitness() << endl; return 0; } diff --git a/eo/test/t-eoinclusion.cpp b/eo/test/t-eoinclusion.cpp index 8a2ea223..415b7d20 100644 --- a/eo/test/t-eoinclusion.cpp +++ b/eo/test/t-eoinclusion.cpp @@ -32,8 +32,8 @@ main() for (unsigned POP_SIZE = 4; POP_SIZE <=6; POP_SIZE++) { eoPop pop; - - for (unsigned i = 0; i < POP_SIZE; i++) + unsigned i; + for ( i = 0; i < POP_SIZE; i++) { Chrom chrom(CHROM_SIZE); random(chrom); diff --git a/eo/test/t-eoproblem.cpp b/eo/test/t-eoproblem.cpp index 81443c19..05265204 100644 --- a/eo/test/t-eoproblem.cpp +++ b/eo/test/t-eoproblem.cpp @@ -25,13 +25,14 @@ ostream& operator<<(ostream& os, const Chrom& chrom) class Easy//: public eoProblem { public: - const size = 1; + static const unsigned size; float operator()(const Chrom& chrom) { return 1.0 / (fabs(chrom[0]) + 1.0); } }; +const unsigned Easy::size = 1; //-----------------------------------------------------------------------------