*** empty log message ***
This commit is contained in:
parent
a3d4ae8a1e
commit
4bfc3afe9b
4 changed files with 27 additions and 60 deletions
2
eo/NEWS
2
eo/NEWS
|
|
@ -1,7 +1,7 @@
|
|||
* release 0.9.4
|
||||
- Update introductory pages of documentation and webpage.
|
||||
- Remove support for pre-standard C++ compiler (i.e. gcc-2.x), which allows to
|
||||
clean up the code considerably.
|
||||
clean up the code considerably. Assume availability of sstream and limits.
|
||||
|
||||
|
||||
* releases 0.9.3... (latest release is 0.9.3zz, 1. Oct. 2005)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@
|
|||
#ifndef eoSequential_h
|
||||
#define eoSequential_h
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "utils/eoData.h"
|
||||
#include "utils/eoRNG.h"
|
||||
#include "eoSelectOne.h"
|
||||
|
||||
/** Contains the following classes:
|
||||
* - eoSequentialSelect, returns all individuals one by one,
|
||||
* either sorted or shuffled
|
||||
|
|
@ -34,33 +40,23 @@
|
|||
* starting with best, continuing shuffled (see G3 engine)
|
||||
*/
|
||||
|
||||
#include <utils/eoData.h>
|
||||
#include <utils/eoRNG.h>
|
||||
#include <eoSelectOne.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** eoSequentialSelect: returns all individual in order
|
||||
* looping back to the beginning when exhasuted
|
||||
* can be from best to worse, or in random order
|
||||
*
|
||||
* It is the eoSelectOne equivalent of eoDetSelect -
|
||||
* though eoDetSelect always returns individuals from best to worst
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
/** All Individuals in order
|
||||
|
||||
Looping back to the beginning when exhausted, can be from best to
|
||||
worse, or in random order.
|
||||
|
||||
It is the eoSelectOne equivalent of eoDetSelect - though eoDetSelect
|
||||
always returns individuals from best to worst
|
||||
*/
|
||||
template <class EOT> class eoSequentialSelect: public eoSelectOne<EOT>
|
||||
{
|
||||
public:
|
||||
/** Ctor: sets the current pter to MAXINT so init will take place first time
|
||||
/** Ctor: sets the current pter to numeric_limits<unsigned>::max() so init will take place first time
|
||||
not very elegant, maybe ...
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
eoSequentialSelect(bool _ordered = true)
|
||||
: ordered(_ordered), current(std::MAXINT) {}
|
||||
#else
|
||||
eoSequentialSelect(bool _ordered = true)
|
||||
: ordered(_ordered), current(MAXINT) {}
|
||||
#endif
|
||||
: ordered(_ordered), current(std::numeric_limits<unsigned>::max()) {}
|
||||
|
||||
void setup(const eoPop<EOT>& _pop)
|
||||
{
|
||||
|
|
@ -88,28 +84,24 @@ private:
|
|||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** eoEliteSequentialSelect: returns the best individual first,
|
||||
* then the others in sequence (random order).
|
||||
* for G3 evolution engine, see Deb, Anad and Joshi, CEC 2002
|
||||
*
|
||||
* As eoSequentialSelect, it is an eoSelectOne to be used within the eoEaseyEA
|
||||
* algo, but conceptually it should be a global eoSelect, as
|
||||
* it selects a bunch of guys in one go (done in the setup function now)
|
||||
*/
|
||||
|
||||
/** All Individuals in order
|
||||
|
||||
The best individual first, then the others in sequence (random order).
|
||||
for G3 evolution engine, see Deb, Anad and Joshi, CEC 2002
|
||||
|
||||
As eoSequentialSelect, it is an eoSelectOne to be used within the
|
||||
eoEaseyEA algo, but conceptually it should be a global eoSelect, as it
|
||||
selects a bunch of guys in one go (done in the setup function now)
|
||||
*/
|
||||
template <class EOT> class eoEliteSequentialSelect: public eoSelectOne<EOT>
|
||||
{
|
||||
public:
|
||||
|
||||
/** Ctor: sets the current pter to MAXINT so init will take place first time
|
||||
/** Ctor: sets the current pter to numeric_limits<unsigned>::max() so init will take place first time
|
||||
not very elegant, maybe ...
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
eoEliteSequentialSelect(): current(std::MAXINT) {}
|
||||
#else
|
||||
eoEliteSequentialSelect(): current(MAXINT) {}
|
||||
#endif
|
||||
eoEliteSequentialSelect(): current(std::numeric_limits<unsigned>::max()) {}
|
||||
|
||||
void setup(const eoPop<EOT>& _pop)
|
||||
{
|
||||
|
|
@ -150,4 +142,3 @@ private:
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,8 @@
|
|||
// Copyright (C) 2005 Jochen Küpper <jochen@fhi-berlin.mpg.de>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU General Public License as published by the Free Software
|
||||
// Foundation; either version 2 of the License, or (at your option) any later
|
||||
// version.
|
||||
//
|
||||
// This program 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 General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License along with
|
||||
// this program; see the file License. if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
#include "eoData.h"
|
||||
|
||||
#ifdef HAVE_NUMERIC_LIMITS
|
||||
int MAXINT = numeric_limits<int>::max();
|
||||
#else
|
||||
#include <limits.h>
|
||||
int MAXINT = INT_MAX;
|
||||
#endif
|
||||
|
||||
|
||||
// Local Variables:
|
||||
|
|
|
|||
|
|
@ -25,11 +25,6 @@
|
|||
#ifndef EODATA_H
|
||||
#define EODATA_H
|
||||
|
||||
#ifdef MAXINT
|
||||
#undef MAXINT
|
||||
#endif
|
||||
extern int MAXINT;
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#include <math.h>
|
||||
#define _isnan isnan
|
||||
|
|
|
|||
Reference in a new issue