toulbar2
Public Member Functions | Public Attributes | List of all members
GWWAlgorithm Class Reference
Inheritance diagram for GWWAlgorithm:
Inheritance graph
[legend]
Collaboration diagram for GWWAlgorithm:
Collaboration graph
[legend]

Public Member Functions

virtual void populationrandomwalk (OpProblem *problem, Configuration **population)
 
virtual int nb_threshold_population (Configuration **population)
 
void randomwalk (OpProblem *problem, Configuration *configuration)
 
void initthreshold (Configuration **population, int popsize)
 
virtual void thresholdupdate ()
 
virtual void thresholdcomputedelta (Configuration **population)
 
void run (OpProblem *problem, Configuration **population)
 
virtual void regrouping (Configuration **population)
 
void populationkeepbest (OpProblem *problem, Configuration **population)
 
virtual void thresholdchangesupdate ()
 

Public Attributes

int populationsize
 
int regrouptest
 
int lastmovedescent
 
int elitism
 
int nomovestop
 
Long thresholddelta
 
int nbiteration
 
int thresholdchanges
 
int total_nhtries
 
int total_nbmoves
 
LSAlgorithmwalkalgorithm
 
- Public Attributes inherited from IncompleteAlgorithm
Long threshold
 

Detailed Description

the GWW (Go with the winners) algorithms : the different subclasses differ by the way a threshold is managed and the particles are regrouped

Member Function Documentation

◆ initthreshold()

void GWWAlgorithm::initthreshold ( Configuration **  population,
int  popsize 
)
virtual

intialization of the threshold

Reimplemented from IncompleteAlgorithm.

References IncompleteAlgorithm::threshold, and walkalgorithm.

◆ nb_threshold_population()

int GWWAlgorithm::nb_threshold_population ( Configuration **  population)
virtual

the number of particles at the threshold (for statistics) , the population being yet sorted at the function call

Referenced by run().

◆ populationkeepbest()

void GWWAlgorithm::populationkeepbest ( OpProblem problem,
Configuration **  population 
)

in case of elitism, the best particle is put into the population

References OpProblem::best_config, Configuration::copy_element(), populationsize, and Configuration::valuation.

Referenced by run().

◆ populationrandomwalk()

void GWWAlgorithm::populationrandomwalk ( OpProblem problem,
Configuration **  population 
)
virtual

◆ randomwalk()

void GWWAlgorithm::randomwalk ( OpProblem problem,
Configuration configuration 
)
virtual

◆ regrouping()

void GWWAlgorithm::regrouping ( Configuration **  population)
virtual

regrouping of the best particles on the good ones

Referenced by run().

◆ run()

void GWWAlgorithm::run ( OpProblem problem,
Configuration **  population 
)
virtual

◆ thresholdchangesupdate()

void GWWAlgorithm::thresholdchangesupdate ( )
virtual

incrementing the threshold updates counter (for the statistics)

Referenced by run().

◆ thresholdcomputedelta()

void GWWAlgorithm::thresholdcomputedelta ( Configuration **  population)
virtual

method for computing the threshold decrement

Referenced by run().

◆ thresholdupdate()

void GWWAlgorithm::thresholdupdate ( )
virtual

method for lowering the threshold( the delta has already been computed)

Referenced by randomwalk(), and run().

Member Data Documentation

◆ elitism

int GWWAlgorithm::elitism

elitism parameter : is the best particle put again in the population at each regroupment ( 1 yes, 0 no)

Referenced by run().

◆ lastmovedescent

int GWWAlgorithm::lastmovedescent

parameter if the threshold is lowered at the last move of the walk (for trying to avoid the particle to be redistributed (1 yes, 0 no)

Referenced by randomwalk().

◆ nbiteration

int GWWAlgorithm::nbiteration

the maximum number of iterations : useful when no threshold is managed (NothresholdGWWAlgorithm)

Referenced by run().

◆ nomovestop

int GWWAlgorithm::nomovestop

parameter for stopping the walk in case of stagnation (1 yes, 0 no)

Referenced by randomwalk().

◆ populationsize

int GWWAlgorithm::populationsize

number of particles

Referenced by populationkeepbest(), populationrandomwalk(), and run().

◆ regrouptest

int GWWAlgorithm::regrouptest

walk indicator : a walk is performed only is the particle has been regrouped : (1 yes, 0 no) (useful for a standard GWW with random walk (and no local search))

Referenced by run().

◆ thresholdchanges

int GWWAlgorithm::thresholdchanges

number of threshold changes (for the statistics)

Referenced by run().

◆ thresholddelta

Long GWWAlgorithm::thresholddelta

the threshold decrement (compted by thresholdcomputedelta)

Referenced by run().

◆ total_nbmoves

int GWWAlgorithm::total_nbmoves

total number of moves between 2 regroupments (for the statistics)

Referenced by populationrandomwalk(), and run().

◆ total_nhtries

int GWWAlgorithm::total_nhtries

total number of move tries between 2 regroupments (for the statistics)

Referenced by populationrandomwalk(), and run().

◆ walkalgorithm

LSAlgorithm* GWWAlgorithm::walkalgorithm

the local search algorithm used

Referenced by initthreshold(), populationrandomwalk(), randomwalk(), and run().