Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

gal::Problem< T > Class Template Reference

Contains information on the problem that is to be solved with GA. More...

#include <Problem.h>

Inheritance diagram for gal::Problem< T >:

[legend]
List of all members.

Public Member Functions

virtual Chromosome< T > *const constructChromosome (int chromoLength)=0
 Returns a new Chromosome<T>.
virtual Chromosome< T > *const copyChromosome (Chromosome< T > *chromo)=0
 Returns a new Chromosome<T>, which is a copy of the specified chromosome.
virtual void const deleteChromosome (Chromosome< T > *chromo)=0
 Deletes a Chromosome<T>* Usually this will be an instance of *a subclass of* Chromosome<T>.
virtual double const evaluateObjective (Chromosome< T > *chromo)=0
 Evaluates the objective function for the value that a chromosome represents.

Detailed Description

template<class T>
class gal::Problem< T >

Contains information on the problem that is to be solved with GA.

A gal::Population requires an instance of a subclass of gal::Problem. Both the objective function and some representation-related functions are relevant.

You always need to use a subclass of this class, where all virtual functions below are defined.


Member Function Documentation

template<class T>
virtual Chromosome<T>* const gal::Problem< T >::constructChromosome int  chromoLength  )  [pure virtual]
 

Returns a new Chromosome<T>.

Usually this will be an instance of *a subclass of* Chromosome<T>.

Implemented in gal::MaxIntProblem.

template<class T>
virtual Chromosome<T>* const gal::Problem< T >::copyChromosome Chromosome< T > *  chromo  )  [pure virtual]
 

Returns a new Chromosome<T>, which is a copy of the specified chromosome.

Usually this will be an instance of *a subclass of* Chromosome<T>. (necessary, because static typing makes a copy constructor impossible)

Implemented in gal::MaxIntProblem.

template<class T>
virtual void const gal::Problem< T >::deleteChromosome Chromosome< T > *  chromo  )  [pure virtual]
 

Deletes a Chromosome<T>* Usually this will be an instance of *a subclass of* Chromosome<T>.

(necessary, because static typing would otherwise default to the superclass's destructor, and would then result in a memory leak.)

Implemented in gal::MaxIntProblem.

template<class T>
virtual double const gal::Problem< T >::evaluateObjective Chromosome< T > *  chromo  )  [pure virtual]
 

Evaluates the objective function for the value that a chromosome represents.

Implemented in gal::MaxIntProblem.


The documentation for this class was generated from the following file:
Generated on Tue Oct 20 12:59:25 2009 for LabSci GALib optimisation by genetic algorithms, student version by  doxygen 1.3.9.1