#include <PO.h>
Public Types | |
typedef PO< F >::Fitness | Fitness |
Public Member Functions | |
PO () | |
Default constructor. | |
Fitness | fitness () const |
Return fitness value. | |
void | fitness (const Fitness &_fitness) |
Set fitness. | |
Fitness | best () const |
Return the best fitness. | |
void | best (const Fitness &_bestFitness) |
Set the best fitness. | |
bool | invalid () const |
Return true If fitness value is invalid, false otherwise. | |
void | invalidate () |
Invalidate the fitness. | |
bool | invalidBest () const |
Return true If the best fitness value is invalid, false otherwise. | |
void | invalidateBest () |
Invalidate the best fitness. | |
virtual std::string | className () const |
Return the class id. | |
bool | operator< (const PO &_po2) const |
Returns true if. | |
bool | operator> (const PO &_po2) const |
virtual void | printOn (std::ostream &_os) const |
Write object. | |
virtual void | readFrom (std::istream &_is) |
Read object. | |
Private Attributes | |
Fitness | repFitness |
bool | invalidFitness |
Fitness | bestFitness |
bool | invalidBestFitness |
A best fitness also belongs to the particle.Fitness says how good is the particle for a current iteration whereas the best fitness can be saved for many iterations.
Definition at line 39 of file PO.h.
void PO< F >::fitness | ( | const Fitness & | _fitness | ) | [inline] |
Fitness PO< F >::best | ( | ) | const [inline] |
Return the best fitness.
Definition at line 74 of file PO.h.
Referenced by eoVectorParticle< eoScalarFitness, bool, double >::operator<().
void PO< F >::best | ( | const Fitness & | _bestFitness | ) | [inline] |
bool PO< F >::invalid | ( | ) | const [inline] |
Return true If fitness value is invalid, false otherwise.
Reimplemented from EO< F >.
Definition at line 95 of file PO.h.
Referenced by PO< eoScalarFitness >::best(), and PO< eoScalarFitness >::fitness().
void PO< F >::invalidate | ( | void | ) | [inline] |
bool PO< F >::invalidBest | ( | ) | const [inline] |
void PO< F >::invalidateBest | ( | ) | [inline] |
virtual std::string PO< F >::className | ( | void | ) | const [inline, virtual] |
Return the class id.
Reimplemented from EO< F >.
Reimplemented in eoBitParticle< FitT >, and eoRealParticle< FitT >.
virtual void PO< F >::printOn | ( | std::ostream & | _os | ) | const [inline, virtual] |
Write object.
Called printOn since it prints the object _on_ a stream.
_os | A std::ostream. |
Reimplemented from EO< F >.
Reimplemented in eoVectorParticle< FitT, PositionType, VelocityType >, eoVectorParticle< eoScalarFitness, double, double >, and eoVectorParticle< eoScalarFitness, bool, double >.
Definition at line 143 of file PO.h.
Referenced by eoVectorParticle< eoScalarFitness, bool, double >::printOn().
virtual void PO< F >::readFrom | ( | std::istream & | _is | ) | [inline, virtual] |
Read object.
\ Calls base class, just in case that one had something to do. The read and print methods should be compatible and have the same format. In principle, format is "plain": they just print a number
_is | a std::istream. |
runtime_std::exception | If a valid object can't be read. |
Reimplemented from EO< F >.