EasyLocal++ Documentation


 
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

easylocal::HillClimbing Class Template Reference

#include <EasyLocal.h>

Inheritance diagram for easylocal::HillClimbing

Inheritance graph
[legend]
Collaboration diagram for easylocal::HillClimbing:

Collaboration graph
[legend]
List of all members.

Public Methods

Protected Methods


Detailed Description

template<class Input, class State, class Move> class easylocal::HillClimbing

The Hill Climbing runner considers random move selection. A move is then performed only if it does improve or it leaves unchanged the value of the cost function.

Definition at line 677 of file EasyLocal.h.


Constructor & Destructor Documentation

template<class Input, class State, class Move>
easylocal::HillClimbing< Input, State, Move >::HillClimbing<Input, State, Move> ( StateManager< Input, State > * s,
NeighborhoodExplorer< Input, State, Move > * ne,
Input * in = NULL ) [protected]
 

Constructs a hill climbing runner by linking it to a state manager, a neighborhood explorer, and an input object.

Parameters:
s   a pointer to a compatible state manager
ne   a pointer to a compatible neighborhood explorer
in   a poiter to an input object

Definition at line 1092 of file EasyLocalTemplates.cpp.


Member Function Documentation

template<class Input, class State, class Move>
bool easylocal::HillClimbing< Input, State, Move >::AcceptableMove ( ) [protected, virtual]
 

A move is accepted if it is non worsening (i.e., it improves the cost or leaves it unchanged).

Reimplemented from easylocal::MoveRunner.

Definition at line 1155 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::InitializeRun ( ) [protected, virtual]
 

The hill climbing initialization simply invokes the superclass companion method.

Reimplemented from easylocal::MoveRunner.

Definition at line 1125 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::Print ( std::ostream & os = std::cout ) const [virtual]
 

Outputs some hill climbing statistics on a given output stream.

Parameters:
os   the output stream

Reimplemented from easylocal::MoveRunner.

Definition at line 1177 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::ReadParameters ( ) [virtual]
 

Reads the hill climbing parameters from the standard input.

Reimplemented from easylocal::Runner.

Definition at line 1102 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::SelectMove ( ) [protected, virtual]
 

The select move strategy for the hill climbing simply looks for a random move.

Reimplemented from easylocal::MoveRunner.

Definition at line 1114 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
bool easylocal::HillClimbing< Input, State, Move >::StopCriterion ( ) [protected, virtual]
 

The stop criterion for the hill climbing strategy is based on the number of iterations elapsed from the last strict improving move performed.

Reimplemented from easylocal::MoveRunner.

Definition at line 1147 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::StoreMove ( ) [protected, virtual]
 

The store move for hill climbing simply updates the variable that keeps track of the last improvement.

Reimplemented from easylocal::MoveRunner.

Definition at line 1163 of file EasyLocalTemplates.cpp.

template<class Input, class State, class Move>
void easylocal::HillClimbing< Input, State, Move >::TerminateRun ( ) [protected, virtual]
 

At the end of the run, the best state found is set with the last visited state (it is always a local minimum).

Reimplemented from easylocal::MoveRunner.

Definition at line 1136 of file EasyLocalTemplates.cpp.


The documentation for this class was generated from the following files:
 
Go to: the Main Page of the documentation.