#include <Population.h>

Public Member Functions | |
| Population () | |
| Population (unsigned) | |
| Population (const Individual &) | |
| Population (unsigned, const Individual &) | |
| Population (unsigned, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &, const Chromosome &) | |
| Population (unsigned, const std::vector< Chromosome * > &) | |
| Population (const Population &) | |
| Population (const std::vector< Individual * > &) | |
| virtual | ~Population () |
| unsigned | size () const |
| void | resize (unsigned n) |
| void | setMaximize () |
| void | setMinimize () |
| void | spinWheelOneTime () |
| void | spinWheelMultipleTimes () |
| bool | ascendingFitness () const |
| Individual & | operator[] (unsigned i) |
| const Individual & | operator[] (unsigned i) const |
| Population | operator() (unsigned from, unsigned to) const |
| Population & | operator= (const Individual &ind) |
| Population & | operator= (const Population &pop) |
| std::vector< const Chromosome * > | matingPool (unsigned chrom, unsigned from=0, unsigned to=0) const |
| void | swap (unsigned i, unsigned j) |
| void | sort () |
| void | shuffle () |
| void | replace (unsigned i, const Individual &ind) |
| void | replace (unsigned i, const Population &pop) |
| void | insert (unsigned i, const Individual &ind) |
| void | insert (unsigned i, const Population &pop) |
| void | append (const Individual &ind) |
| void | append (const Population &pop) |
| void | remove (unsigned i) |
| void | remove (unsigned from, unsigned to) |
| void | exchange (Population &pop) |
| unsigned | bestIndex () const |
| unsigned | worstIndex () const |
| Individual & | oneOfBest () |
| const Individual & | oneOfBest () const |
| Individual & | best () |
| const Individual & | best () const |
| Individual & | worst () |
| const Individual & | worst () const |
| Individual & | random () |
| const Individual & | random () const |
| void | reproduce (Population &parents, unsigned nelitists=0) |
| void | linearDynamicScaling (std::vector< double > &window, unsigned long t) |
| Individual & | selectOneIndividual () |
| void | selectMuLambda (Population &parents, unsigned nelitists=0) |
| void | selectMuLambdaKappa (Population &parents, unsigned lifespan=1, unsigned adolescence=0) |
| void | selectProportional (Population &parents, unsigned nelitists=0) |
| void | selectLinearRanking (Population &parents, double etaMax=1.1, unsigned nelitists=0) |
| void | selectUniformRanking (Population &parents, unsigned nelitists=0) |
| void | selectTournament (Population &parents, unsigned q=2, unsigned nelitists=0) |
| void | selectLinearRankingWhitley (Population &parents, double a=1.1, unsigned nelitists=0) |
| void | selectEPTournament (Population &parents, unsigned q) |
| void | replaceUnconditional (Population &parents) |
| void | replaceConditional (Population &parents) |
| void | replaceRanking (Population &parents) |
| void | replaceRankingConditional (Population &parents) |
| double | minFitness () const |
| double | maxFitness () const |
| double | meanFitness () const |
| double | stdDevFitness () const |
| void | setAge (unsigned a=0) |
| void | incAge () |
| bool | operator== (const Population &) const |
| bool | operator< (const Population &) const |
| void | setIndex (unsigned i) |
| unsigned | getIndex () const |
| void | setSubPop (bool sub) |
| bool | getSubPop () const |
| bool | getSpinOnce () const |
| int | pvm_pkpop () |
| int | pvm_upkpop () |
Protected Member Functions | |
| Individual & | best (Individual &, Individual &) const |
| Individual & | worst (Individual &, Individual &) const |
| void | sortIndividuals (std::vector< Individual * > &) |
| void | selectInit () |
| void | selectElitists (Population &, unsigned) |
| void | selectRouletteWheel (Population &, unsigned) |
Static Protected Member Functions | |
| static bool | lessFitness (Individual *const &, Individual *const &) |
| static bool | greaterFitness (Individual *const &, Individual *const &) |
| static bool | greaterScoreAscending (Individual *const &i1, Individual *const &i2) |
| static bool | greaterScoreDescending (Individual *const &i1, Individual *const &i2) |
Protected Attributes | |
| unsigned | index |
| bool | subPop |
| bool | ascending |
| bool | spinOnce |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Population &pop) |
| std::istream & | operator>> (std::istream &is, Population &pop) |
integerES.cpp, and pvmSphereGA.cpp.
Definition at line 55 of file Population.h.
| Population::Population | ( | ) |
Definition at line 52 of file Population.cpp.
References ascending, spinOnce, and subPop.
Referenced by operator()().
| Population::Population | ( | unsigned | n | ) | [explicit] |
| Population::Population | ( | const Individual & | indiv | ) |
| Population::Population | ( | unsigned | n, | |
| const Individual & | indiv | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2, | |||
| const Chromosome & | chrom3 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2, | |||
| const Chromosome & | chrom3, | |||
| const Chromosome & | chrom4 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2, | |||
| const Chromosome & | chrom3, | |||
| const Chromosome & | chrom4, | |||
| const Chromosome & | chrom5 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2, | |||
| const Chromosome & | chrom3, | |||
| const Chromosome & | chrom4, | |||
| const Chromosome & | chrom5, | |||
| const Chromosome & | chrom6 | |||
| ) |
| Population::Population | ( | unsigned | n, | |
| const Chromosome & | chrom0, | |||
| const Chromosome & | chrom1, | |||
| const Chromosome & | chrom2, | |||
| const Chromosome & | chrom3, | |||
| const Chromosome & | chrom4, | |||
| const Chromosome & | chrom5, | |||
| const Chromosome & | chrom6, | |||
| const Chromosome & | chrom7 | |||
| ) |
| Population::Population | ( | unsigned | , | |
| const std::vector< Chromosome * > & | ||||
| ) |
| Population::Population | ( | const Population & | pop | ) |
| Population::Population | ( | const std::vector< Individual * > & | ) |
| Population::~Population | ( | ) | [virtual] |
| void Population::append | ( | const Population & | pop | ) |
| void Population::append | ( | const Individual & | ind | ) |
Definition at line 394 of file Population.cpp.
| bool Population::ascendingFitness | ( | ) | const [inline] |
| Individual & Population::best | ( | Individual & | ind0, | |
| Individual & | ind1 | |||
| ) | const [protected] |
| const Individual& Population::best | ( | ) | const [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 203 of file Population.h.
References bestIndex().
| Individual& Population::best | ( | ) | [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 199 of file Population.h.
References bestIndex().
Referenced by selectTournament().
| unsigned Population::bestIndex | ( | ) | const |
Definition at line 529 of file Population.cpp.
References ascending, and size().
Referenced by best().
| void Population::exchange | ( | Population & | pop | ) |
| unsigned Population::getIndex | ( | ) | const [inline] |
| bool Population::getSpinOnce | ( | ) | const [inline] |
| bool Population::getSubPop | ( | ) | const [inline] |
| bool Population::greaterFitness | ( | Individual *const & | i1, | |
| Individual *const & | i2 | |||
| ) | [static, protected] |
| bool Population::greaterScoreAscending | ( | Individual *const & | i1, | |
| Individual *const & | i2 | |||
| ) | [static, protected] |
Definition at line 1112 of file Population.cpp.
References Individual::fitness, and Individual::scaledFitness.
Referenced by selectEPTournament().
| bool Population::greaterScoreDescending | ( | Individual *const & | i1, | |
| Individual *const & | i2 | |||
| ) | [static, protected] |
Definition at line 1121 of file Population.cpp.
References Individual::fitness, and Individual::scaledFitness.
Referenced by selectEPTournament().
| void Population::incAge | ( | ) |
Definition at line 1311 of file Population.cpp.
References size().
Referenced by selectMuLambdaKappa().
| void Population::insert | ( | unsigned | i, | |
| const Population & | pop | |||
| ) |
| void Population::insert | ( | unsigned | i, | |
| const Individual & | ind | |||
| ) |
| bool Population::lessFitness | ( | Individual *const & | i1, | |
| Individual *const & | i2 | |||
| ) | [static, protected] |
| void Population::linearDynamicScaling | ( | std::vector< double > & | window, | |
| unsigned long | t | |||
| ) |
| vector< const Chromosome * > Population::matingPool | ( | unsigned | chrom, | |
| unsigned | from = 0, |
|||
| unsigned | to = 0 | |||
| ) | const |
| double Population::maxFitness | ( | ) | const |
| double Population::meanFitness | ( | ) | const |
| double Population::minFitness | ( | ) | const |
| const Individual & Population::oneOfBest | ( | ) | const |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 505 of file Population.cpp.
References ascending, maxFitness(), minFitness(), and size().
| Individual & Population::oneOfBest | ( | ) |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 482 of file Population.cpp.
References ascending, maxFitness(), minFitness(), and size().
| Population Population::operator() | ( | unsigned | from, | |
| unsigned | to | |||
| ) | const [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 145 of file Population.h.
References Population(), and size().
| bool Population::operator< | ( | const Population & | pop | ) | const |
| Population & Population::operator= | ( | const Population & | pop | ) |
| Population & Population::operator= | ( | const Individual & | ind | ) |
| bool Population::operator== | ( | const Population & | pop | ) | const |
| const Individual& Population::operator[] | ( | unsigned | i | ) | const [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 139 of file Population.h.
References size().
| Individual& Population::operator[] | ( | unsigned | i | ) | [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 133 of file Population.h.
References size().
| int Population::pvm_pkpop | ( | ) |
Part of PVM-send routine for populations
Definition at line 786 of file Population.cpp.
References ascending, index, pvm_pkuint(), size(), spinOnce, and subPop.
| int Population::pvm_upkpop | ( | ) |
Part of PVM-receive routine for populations
Definition at line 811 of file Population.cpp.
References ascending, index, pvm_upkuint(), size(), spinOnce, and subPop.
| const Individual& Population::random | ( | ) | const [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 221 of file Population.h.
References size().
| Individual& Population::random | ( | ) | [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 217 of file Population.h.
References size().
Referenced by selectTournament().
| void Population::remove | ( | unsigned | from, | |
| unsigned | to | |||
| ) |
| void Population::remove | ( | unsigned | i | ) |
| void Population::replace | ( | unsigned | i, | |
| const Population & | pop | |||
| ) |
| void Population::replace | ( | unsigned | i, | |
| const Individual & | ind | |||
| ) |
| void Population::replaceConditional | ( | Population & | parents | ) |
| void Population::replaceRanking | ( | Population & | parents | ) |
| void Population::replaceRankingConditional | ( | Population & | parents | ) |
| void Population::replaceUnconditional | ( | Population & | parents | ) |
| void Population::reproduce | ( | Population & | parents, | |
| unsigned | nelitists = 0 | |||
| ) | [inline] |
| void Population::resize | ( | unsigned | n | ) |
Definition at line 253 of file Population.cpp.
References insert(), and size().
Referenced by PopulationCT< ChromosomeT< T > >::PopulationCT(), and PopulationT< double >::PopulationT().
| void Population::selectElitists | ( | Population & | parents, | |
| unsigned | numElitists | |||
| ) | [protected] |
Definition at line 581 of file Population.cpp.
References size(), and sortIndividuals().
Referenced by selectLinearRanking(), selectLinearRankingWhitley(), selectMuLambda(), selectProportional(), selectTournament(), and selectUniformRanking().
| void Population::selectEPTournament | ( | Population & | parents, | |
| unsigned | q | |||
| ) |
Definition at line 1168 of file Population.cpp.
References ascending, greaterScoreAscending(), greaterScoreDescending(), size(), and sort().
| void Population::selectInit | ( | ) | [protected] |
Definition at line 573 of file Population.cpp.
References size().
Referenced by selectLinearRanking(), selectLinearRankingWhitley(), selectMuLambda(), selectMuLambdaKappa(), selectProportional(), selectTournament(), and selectUniformRanking().
| void Population::selectLinearRanking | ( | Population & | parents, | |
| double | etaMax = 1.1, |
|||
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 946 of file Population.cpp.
References selectElitists(), selectInit(), selectRouletteWheel(), size(), and sortIndividuals().
| void Population::selectLinearRankingWhitley | ( | Population & | parents, | |
| double | a = 1.1, |
|||
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 1067 of file Population.cpp.
References selectElitists(), selectInit(), size(), and sortIndividuals().
| void Population::selectMuLambda | ( | Population & | parents, | |
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 670 of file Population.cpp.
References selectElitists(), selectInit(), size(), and sortIndividuals().
Referenced by CMSASearch::run(), and CMASearch::run().
| void Population::selectMuLambdaKappa | ( | Population & | parents, | |
| unsigned | lifespan = 1, |
|||
| unsigned | adolescence = 0 | |||
| ) |
Definition at line 708 of file Population.cpp.
References incAge(), selectInit(), size(), sort(), and sortIndividuals().
| Individual & Population::selectOneIndividual | ( | ) |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 913 of file Population.cpp.
References Individual::scaledFitness, and size().
| void Population::selectProportional | ( | Population & | parents, | |
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 878 of file Population.cpp.
References selectElitists(), selectInit(), selectRouletteWheel(), and size().
| void Population::selectRouletteWheel | ( | Population & | parents, | |
| unsigned | numElitists | |||
| ) | [protected] |
Definition at line 620 of file Population.cpp.
References size(), and spinOnce.
Referenced by selectLinearRanking(), selectProportional(), and selectUniformRanking().
| void Population::selectTournament | ( | Population & | parents, | |
| unsigned | q = 2, |
|||
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 1016 of file Population.cpp.
References best(), Individual::elitist, Individual::numCopies, random(), selectElitists(), selectInit(), and size().
| void Population::selectUniformRanking | ( | Population & | parents, | |
| unsigned | nelitists = 0 | |||
| ) |
Definition at line 990 of file Population.cpp.
References selectElitists(), selectInit(), selectRouletteWheel(), and size().
Referenced by reproduce().
| void Population::setAge | ( | unsigned | a = 0 |
) |
| void Population::setIndex | ( | unsigned | i | ) | [inline] |
| void Population::setMaximize | ( | ) | [inline] |
| void Population::setMinimize | ( | ) | [inline] |
Definition at line 114 of file Population.h.
References ascending.
Referenced by CMAElitistSearch::init(), CMSASearch::init(), and CMASearch::init().
| void Population::setSubPop | ( | bool | sub | ) | [inline] |
| void Population::shuffle | ( | ) |
| unsigned Population::size | ( | ) | const [inline] |
Definition at line 103 of file Population.h.
Referenced by append(), bestIndex(), CMSA::cog(), CMA::cog(), exchange(), incAge(), CMSA::init(), CMA::init(), insert(), matingPool(), maxFitness(), meanFitness(), minFitness(), ElitistCMA::Mutate(), oneOfBest(), PopulationT< double >::operator()(), PopulationCT< ChromosomeT< T > >::operator()(), operator()(), operator<(), operator=(), operator==(), operator[](), Population(), PopulationCT< ChromosomeT< T > >::PopulationCT(), PopulationT< double >::PopulationT(), pvm_pkpop(), pvm_upkpop(), random(), remove(), replace(), resize(), CMSASearch::run(), CMASearch::run(), ElitistCMA::SelectAndUpdateStrategyParameters(), selectElitists(), selectEPTournament(), selectInit(), selectLinearRanking(), selectLinearRankingWhitley(), selectMuLambda(), selectMuLambdaKappa(), selectOneIndividual(), selectProportional(), selectRouletteWheel(), selectTournament(), selectUniformRanking(), setAge(), shuffle(), stdDevFitness(), swap(), UncertaintyQuantification(), CMSA::updateStrategyParameters(), CMA::updateStrategyParameters(), worstIndex(), and ~Population().
| void Population::sort | ( | ) |
Definition at line 342 of file Population.cpp.
References sortIndividuals().
Referenced by selectEPTournament(), and selectMuLambdaKappa().
| void Population::sortIndividuals | ( | std::vector< Individual * > & | ) | [protected] |
Referenced by selectElitists(), selectLinearRanking(), selectLinearRankingWhitley(), selectMuLambda(), selectMuLambdaKappa(), and sort().
| void Population::spinWheelMultipleTimes | ( | ) | [inline] |
| void Population::spinWheelOneTime | ( | ) | [inline] |
| double Population::stdDevFitness | ( | ) | const |
| void Population::swap | ( | unsigned | i, | |
| unsigned | j | |||
| ) | [inline] |
| Individual & Population::worst | ( | Individual & | ind0, | |
| Individual & | ind1 | |||
| ) | const [protected] |
| const Individual& Population::worst | ( | ) | const [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 212 of file Population.h.
References worstIndex().
| Individual& Population::worst | ( | ) | [inline] |
Reimplemented in PopulationCT< CT >, PopulationT< T >, PopulationCT< ChromosomeCMA >, PopulationCT< ChromosomeT< T > >, and PopulationT< double >.
Definition at line 208 of file Population.h.
References worstIndex().
| unsigned Population::worstIndex | ( | ) | const |
Definition at line 551 of file Population.cpp.
References ascending, and size().
Referenced by worst().
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Population & | pop | |||
| ) | [friend] |
Definition at line 332 of file Population.h.
| std::istream& operator>> | ( | std::istream & | is, | |
| Population & | pop | |||
| ) | [friend] |
Definition at line 345 of file Population.h.
bool Population::ascending [protected] |
Definition at line 313 of file Population.h.
Referenced by ascendingFitness(), best(), bestIndex(), exchange(), oneOfBest(), operator==(), Population(), PopulationCT< ChromosomeT< T > >::PopulationCT(), PopulationT< double >::PopulationT(), pvm_pkpop(), pvm_upkpop(), selectEPTournament(), setMaximize(), setMinimize(), worst(), and worstIndex().
unsigned Population::index [protected] |
Definition at line 311 of file Population.h.
Referenced by exchange(), getIndex(), operator==(), pvm_pkpop(), pvm_upkpop(), and setIndex().
bool Population::spinOnce [protected] |
Definition at line 314 of file Population.h.
Referenced by exchange(), getSpinOnce(), operator==(), Population(), PopulationCT< ChromosomeT< T > >::PopulationCT(), PopulationT< double >::PopulationT(), pvm_pkpop(), pvm_upkpop(), selectRouletteWheel(), spinWheelMultipleTimes(), and spinWheelOneTime().
bool Population::subPop [protected] |
Definition at line 312 of file Population.h.
Referenced by exchange(), getSubPop(), operator=(), operator==(), Population(), PopulationCT< ChromosomeT< T > >::PopulationCT(), PopulationT< double >::PopulationT(), pvm_pkpop(), pvm_upkpop(), setSubPop(), and ~Population().