This interface allow to define how to obtain the local search method. More...
#include <ilocalsearch.h>
Inherited by realea::IParallelLocalSearch.
Public Member Functions | |
virtual ILSParameters * | getInitOptions (tChromosomeReal &sol)=0 |
virtual unsigned | apply (ILSParameters *params, tChromosomeReal &sol, tFitness &fitness, unsigned nstep)=0 |
void | setPopulation (PopulationReal *pop) |
void | setRunning (RunningPtr run) |
void | setProblem (Problem *problem) |
void | setRandom (Random *random) |
Protected Attributes | |
Random * | m_random |
Problem * | m_problem |
RunningPtr | m_running |
This interface allow to define how to obtain the local search method.
To define new Local Search methods it is only required to implement this interface and define apply and getInitOptions methods.
Definition at line 52 of file ilocalsearch.h.
virtual unsigned realea::ILocalSearch::apply | ( | ILSParameters * | params, | |
tChromosomeReal & | sol, | |||
tFitness & | fitness, | |||
unsigned | nstep | |||
) | [pure virtual] |
Apply the LS method improvement
params | the initial parameters of the LS, initialised by getInitOptions | |
sol | chromosome to be improved, it is changed | |
fitness | fitness of chromosome 'sol', it is updated by the new sol values | |
nstep | evaluation number into the LS process |
virtual ILSParameters* realea::ILocalSearch::getInitOptions | ( | tChromosomeReal & | sol | ) | [pure virtual] |
Obtain the initial parameter to local searchObtain the initial parameter to local search.
sol | chromosome to be improved |
void realea::ILocalSearch::setPopulation | ( | PopulationReal * | pop | ) | [inline] |
Allow to specify the population whose individuals will be improved
pop | population |
Definition at line 81 of file ilocalsearch.h.
void realea::ILocalSearch::setProblem | ( | Problem * | problem | ) | [inline] |
Set the problem
problem | problem to be evaluated |
Definition at line 99 of file ilocalsearch.h.
void realea::ILocalSearch::setRandom | ( | Random * | random | ) | [inline] |
void realea::ILocalSearch::setRunning | ( | RunningPtr | run | ) | [inline] |
Set the running criterion
run | stop criterion |
Definition at line 90 of file ilocalsearch.h.
Problem* realea::ILocalSearch::m_problem [protected] |
The current evaluation function The current problem
Definition at line 122 of file ilocalsearch.h.
Random* realea::ILocalSearch::m_random [protected] |
The current randomgeneration numbers
Definition at line 120 of file ilocalsearch.h.
RunningPtr realea::ILocalSearch::m_running [protected] |
The current population The stopping criterion
Definition at line 124 of file ilocalsearch.h.