ECF 1.5
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Fitness Class Referenceabstract

Fitness base class. More...

#include <Fitness.h>

Inheritance diagram for Fitness:
FitnessMax FitnessMin LexiCaseFitnessMin LexiCaseFitnessMin LexiCaseFitnessMin MOFitness

Public Member Functions

virtual bool isBetterThan (FitnessP)=0
 Mandatory comparison operator. More...
 
virtual Fitnesscopy ()=0
 object copy (for duplication of an individual) More...
 
bool isValid ()
 Is fitness object up to date. More...
 
void setInvalid ()
 Set fitness object to invalid state (called after any change of individual's genotype). More...
 
virtual void setValue (double value)
 Set fitness value. More...
 
virtual double getValue ()
 Return fitness value. More...
 
virtual void write (XMLNode &)
 Write fitness object to XMLNode. More...
 
std::string toString ()
 Output fitness XML format as std::string. More...
 
virtual void read (XMLNode &xFitness)
 Read single fitness value from XML node. If the value is undefined (e.g. when reading unevaluated individual from XMLNode), validity is set to false. More...
 

Public Attributes

uint cid
 coherence index, used in asynchronous parallel algoritmhs More...
 

Protected Attributes

bool valid_
 is fitness value up-to-date More...
 
double value_
 actual fitness value More...
 
Individualindividual_
 

Detailed Description

Fitness base class.

A fitness object is used to represent individual's appropriateness for the problem.

Definition at line 15 of file Fitness.h.

Constructor & Destructor Documentation

◆ Fitness()

Fitness::Fitness ( )
inline

Definition at line 28 of file Fitness.h.

◆ ~Fitness()

virtual Fitness::~Fitness ( )
inlinevirtual

Definition at line 87 of file Fitness.h.

Member Function Documentation

◆ copy()

virtual Fitness * Fitness::copy ( )
pure virtual

object copy (for duplication of an individual)

Implemented in FitnessMax, FitnessMin, MOFitness, LexiCaseFitnessMin, LexiCaseFitnessMin, and LexiCaseFitnessMin.

◆ getValue()

virtual double Fitness::getValue ( )
inlinevirtual

Return fitness value.

Reimplemented in MOFitness, LexiCaseFitnessMin, LexiCaseFitnessMin, and LexiCaseFitnessMin.

Definition at line 55 of file Fitness.h.

◆ isBetterThan()

virtual bool Fitness::isBetterThan ( FitnessP  )
pure virtual

Mandatory comparison operator.

Returns
true if this object is 'better' than the given parameter fitness object

Implemented in FitnessMax, FitnessMin, and MOFitness.

◆ isValid()

bool Fitness::isValid ( )
inline

Is fitness object up to date.

Definition at line 43 of file Fitness.h.

◆ read()

virtual void Fitness::read ( XMLNode &  xFitness)
inlinevirtual

Read single fitness value from XML node. If the value is undefined (e.g. when reading unevaluated individual from XMLNode), validity is set to false.

Definition at line 76 of file Fitness.h.

◆ setInvalid()

void Fitness::setInvalid ( )
inline

Set fitness object to invalid state (called after any change of individual's genotype).

Definition at line 47 of file Fitness.h.

◆ setValue()

virtual void Fitness::setValue ( double  value)
inlinevirtual

Set fitness value.

Definition at line 51 of file Fitness.h.

◆ toString()

std::string Fitness::toString ( )
inline

Output fitness XML format as std::string.

Definition at line 62 of file Fitness.h.

◆ write()

virtual void Fitness::write ( XMLNode &  )
inlinevirtual

Write fitness object to XMLNode.

Reimplemented in FitnessMax, FitnessMin, LexiCaseFitnessMin, LexiCaseFitnessMin, LexiCaseFitnessMin, and MOFitness.

Definition at line 59 of file Fitness.h.

Member Data Documentation

◆ cid

uint Fitness::cid

coherence index, used in asynchronous parallel algoritmhs

Definition at line 26 of file Fitness.h.

◆ individual_

Individual* Fitness::individual_
protected

Definition at line 23 of file Fitness.h.

◆ valid_

bool Fitness::valid_
protected

is fitness value up-to-date

Definition at line 18 of file Fitness.h.

◆ value_

double Fitness::value_
protected

actual fitness value

Definition at line 19 of file Fitness.h.


The documentation for this class was generated from the following file: