realea::Problem Class Reference

This class represent a problem to be resolved. More...

#include <problem.h>

Inherits Resetable, and realea::IEval.

Collaboration diagram for realea::Problem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Problem (void)
 Problem (void)
void setEval (tEval eval)
void setMinimize (void)
void setMaximize (void)
bool minimize (void)
bool maximize (void)
bool isBetter (tFitness x, tFitness y)
void setDimension (unsigned int dim)
virtual unsigned int getDimension (void)
void setDomainValues (unsigned int gen, tGen min, tGen max, bool check=true)
void setOptimize (tFitness optime, double threshold)
void setThreshold (double dif)
void setMaxEval (unsigned int maxeval)
unsigned getMaxEval (void)
virtual DomainRealPtr getDomain (void)
tFitness getOptime (void)

Detailed Description

This class represent a problem to be resolved.

To apply the EA to new problems, a subclass of ProblemFactory must be defined, and it must return an adequated initialized problem (instance of this class)

See also:
ProblemFactory

Definition at line 68 of file problem.h.


Constructor & Destructor Documentation

Problem::~Problem ( void   )  [virtual]

Destructor

Definition at line 67 of file problem.cc.

Problem::Problem ( void   ) 

Constructor

Definition at line 26 of file problem.cc.


Member Function Documentation

unsigned Problem::getDimension ( void   )  [virtual]
Returns:
the dimensionality of current problem

Definition at line 124 of file problem.cc.

Here is the call graph for this function:

DomainRealPtr Problem::getDomain ( void   )  [virtual]
Returns:
the domain of the problem

Definition at line 82 of file problem.cc.

unsigned Problem::getMaxEval ( void   ) 
Returns:
the maximum evaluation number

Definition at line 112 of file problem.cc.

tFitness Problem::getOptime ( void   ) 
Returns:
the optime value

Definition at line 97 of file problem.cc.

bool Problem::isBetter ( tFitness  x,
tFitness  y 
)
Returns:
true value1 is better than value2 in the problem

Definition at line 29 of file problem.cc.

bool Problem::maximize ( void   ) 
Returns:
true if it is a maximization problem

Definition at line 41 of file problem.cc.

Here is the call graph for this function:

bool Problem::minimize ( void   ) 
Returns:
true if it is a minimization problem

Definition at line 33 of file problem.cc.

void Problem::setDimension ( unsigned int  dim  ) 

Set the problem's dimensionality

Parameters:
dim new dimensionality

Definition at line 54 of file problem.cc.

void Problem::setDomainValues ( unsigned int  gen,
tGen  min,
tGen  max,
bool  check = true 
)

Set for a gen the range (maximum and minimum values)

Parameters:
gen pos of current gen to set (from 0..getDimension()-1)
min minimum value
max maximum value
check set if the gen must be checked, default true

Definition at line 58 of file problem.cc.

Here is the call graph for this function:

void Problem::setEval ( tEval  eval  ) 

Set the function evaluation. It is a function that return a tFitness from a Chromosome real typedef tFitness (*tEval)(const tGen *x, int dim)

Parameters:
eval Evaluation function.

Definition at line 104 of file problem.cc.

void realea::Problem::setMaxEval ( unsigned int  maxeval  ) 

Set the maximum evaluation number for the problem

Parameters:
maxeval maximum eval number
void Problem::setMaximize ( void   ) 

Set the minimize criterion

Definition at line 45 of file problem.cc.

void Problem::setMinimize ( void   ) 

Set the minimize criterion

Definition at line 49 of file problem.cc.

void Problem::setOptimize ( tFitness  optime,
double  threshold 
)

Set the optimum value and the threshold A solution is an optimum if their difference in fitness with the optimum is lower than this threshould (if it is not defined, threshold is equal to 0)

Parameters:
optime optimum value
threshold threshold value (must be positive)

Definition at line 78 of file problem.cc.

void Problem::setThreshold ( double  dif  ) 

Set the threshold, a solution is an optimum if their difference in fitness with the optimum is lower than this threshould (if it is not defined, threshold is equal to 0)

Parameters:
dif threshold value (must be positive)

Definition at line 89 of file problem.cc.


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

Generated on Sun May 9 12:26:14 2010 for Realea by  doxygen 1.6.1