memetic algorithm following the model proposed in the Daniel Molina's thesis More...
#include <malschains.h>
Inherits realea::Hybrid.
Public Member Functions | |
MALSChains (IEAlgorithm *alg, ILocalSearch *ls) | |
void | setEffortRatio (double ratio) |
void | setRestart (RestartStrategy *restart, int maxfailed=-1) |
unsigned | realApply (tChromosomeReal &sol, tFitness &fitness) |
void | setDisruptionSize (double size) |
Protected Member Functions | |
bool | hasDiversity (PopulationReal *pop) |
void | setDif (bool debug, string ident, unsigned id, tFitness oldfit, tFitness newfit) |
void | disturb (tChromosomeReal &sol) |
memetic algorithm following the model proposed in the Daniel Molina's thesis
Definition at line 36 of file malschains.h.
MALSChains::MALSChains | ( | IEAlgorithm * | alg, | |
ILocalSearch * | ls | |||
) |
Constructor
Definition at line 37 of file malschains.cc.
void MALSChains::disturb | ( | tChromosomeReal & | sol | ) | [protected] |
Disturb the solution (similar to mutation it uses the disruption_size
Definition at line 256 of file malschains.cc.
bool MALSChains::hasDiversity | ( | PopulationReal * | pop | ) | [protected] |
Check if there is enough diversity
Definition at line 227 of file malschains.cc.
unsigned MALSChains::realApply | ( | tChromosomeReal & | sol, | |
tFitness & | fitness | |||
) | [virtual] |
Alter the EA and after the LS, then the EA again, the LS, ...
Implements realea::ProxyEA.
Definition at line 271 of file malschains.cc.
void MALSChains::setDif | ( | bool | debug, | |
string | ident, | |||
unsigned | id, | |||
tFitness | oldfit, | |||
tFitness | newfit | |||
) | [protected] |
Set the differences
Definition at line 214 of file malschains.cc.
void MALSChains::setDisruptionSize | ( | double | size | ) |
Set a distorsion size when the solution is a local optimum
size | size of maximum disruption |
Definition at line 46 of file malschains.cc.
void MALSChains::setEffortRatio | ( | double | ratio | ) | [virtual] |
ratio. | Set the global ratio invested into the Local Search | |
ratio | global ls/total ratio (change the intensity, because only one LS improvement is made) |
Implements realea::Hybrid.
Definition at line 30 of file malschains.cc.
void MALSChains::setRestart | ( | RestartStrategy * | restart, | |
int | maxfailed = -1 | |||
) |
Set the restart strategy. If it is not called never it will make a restart.
Definition at line 125 of file malschains.cc.