Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SimplePopulation Class Reference

A linear set implementation of Population. More...

#include <simplepopula.h>

Inheritance diagram for SimplePopulation:

Population Population List of all members.

Public Methods

 SimplePopulation (EAEnvironment &envr, const StringMap &params)
double evolve (int generations, const char *savefile=NULL, double trg_fitn=-1)
const Individualoperator[] (int i) const
Individualoperator[] (int i)
int size () const
void print (TextOStream &out) const
void report (TextOStream &log) const
const EAStrategygetstrategy () const
int getAge () const
MutationRatemutRate ()
const SelectionPrmsselParams () const
SelectionPrmsselParams ()
void resetFitnesses ()
virtual void check () const
void check () const

Public Attributes

double minsimilarity

Friends

class EAStrategy

Detailed Description

A linear set implementation of Population.

Definition at line 42 of file simplepopula.h.


Constructor & Destructor Documentation

SimplePopulation EAEnvironment   envir,
const StringMap &    params
 

Standard constructor.

* * Copyright (C) 1997-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

Definition at line 32 of file simplepopula.cc.

References SelectionPrms::adaptParams(), EAEnvironment::addFeaturesTo(), Individual::addGenesTo(), Genome::addPrivateGenes(), MutationRate::autoAdaptation(), EAStrategy, Population::mAge, minsimilarity, EAStrategy::print(), Population::rpEnvironment, Gentainer::selfadjust(), SelectionPrms::setEtaPlus(), SelectionPrms::setMu(), SelectionPrms::setMuPart(), and SelectionPrms::setQ().


Member Function Documentation

void check   [virtual]
 

Implementation for Object.

Reimplemented from Population.

void check   [virtual]
 

Implementation for Object.

Reimplemented from Population.

Definition at line 237 of file simplepopula.cc.

References EAStrategy::check(), EAEnvironment::check(), and Population::rpEnvironment.

double evolve int    generations,
const char *    savefile = NULL,
double    trg_fitn = -1
 

Evolves the population.

Parameters:
generations  Number of generations the population should be evolved.
savefile  File where the evolution log should be saved.
trg_fitn  The evolution is terminated if the attained fitness goes smaller than this value. Special value -1 tells not to use this rule.

Definition at line 120 of file simplepopula.cc.

References EAEnvironment::bestfitn, EAStrategy::evolve(), FitnessStats::minFitness(), MutabilityRecord::reset(), and Population::rpEnvironment.

int getAge   const [inline]
 

Returns the number of times the population has been evaluated (i.e.

the generation)

Definition at line 92 of file simplepopula.h.

References Population::mAge.

const EAStrategy& getstrategy   const [inline]
 

Returns the current strategy.

Definition at line 87 of file simplepopula.h.

MutationRate& mutRate   [inline]
 

Returns a non-const reference to the global mutation rate.

Definition at line 96 of file simplepopula.h.

Referenced by EAStrategy::print(), and EAStrategy::recombine().

Individual& operator[] int    i [inline]
 

Returns an individual in the population by it's index number.

As above, except non-conest.

Definition at line 71 of file simplepopula.h.

const Individual& operator[] int    i const [inline]
 

Returns an individual in the population by it's index number.

Definition at line 66 of file simplepopula.h.

void print TextOStream &    out const
 

Dumps the population to given output in a formatted manner.

Definition at line 202 of file simplepopula.cc.

References size().

void report TextOStream &    log const
 

Writes an one-line generation report to the given logging stream.

Definition at line 218 of file simplepopula.cc.

References FitnessStats::avgFitness(), Population::mAge, FitnessStats::maxFitness(), and FitnessStats::minFitness().

Referenced by EAStrategy::evolve().

void resetFitnesses  
 

Resets the stored fitness averages of multiply measured individuals.

Useful when changing the objective function (old fitness values would be invalid).

Definition at line 196 of file simplepopula.cc.

References size().

SelectionPrms& selParams   [inline]
 

Returns a non-const reference to the selection parameters.

Definition at line 103 of file simplepopula.h.

const SelectionPrms& selParams   const [inline]
 

Returns the selection parameters.

Definition at line 100 of file simplepopula.h.

Referenced by Selector::linearRanking(), Selector::muLambdaSelection(), EAStrategy::print(), and Selector::tournamentSelection().

int size   const [inline]
 

Returns the number of individuals in the population.

Definition at line 75 of file simplepopula.h.

Referenced by SelectionMatrix::calculateMatrix(), EAStrategy::EAStrategy(), Selector::linearRanking(), Selector::muLambdaSelection(), print(), EAStrategy::print(), EAStrategy::recombine(), resetFitnesses(), and Selector::tournamentSelection().


Friends And Related Function Documentation

friend class EAStrategy [friend]
 

> Global etaPlus parameter for linear ranking selection.

Reimplemented from Population.

Definition at line 143 of file simplepopula.h.

Referenced by SimplePopulation().


Member Data Documentation

double minsimilarity
 

Minimum allowed similarity between genomes.

Definition at line 48 of file simplepopulation.h.

Referenced by SimplePopulation().


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18