EasyLocal++ Documentation


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

easylocal::LocalSearchSolver Class Template Reference

#include <EasyLocal.h>

Inheritance diagram for easylocal::LocalSearchSolver

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

Collaboration graph
[legend]
List of all members.

Public Methods

Protected Methods

Protected Attributes


Detailed Description

template<class Input, class Output, class State> class easylocal::LocalSearchSolver

A Local Search Solver has an internal state, and defines the ways for dealing with a local search algorithm.

Definition at line 826 of file EasyLocal.h.


Constructor & Destructor Documentation

template<class Input, class Output, class State>
easylocal::LocalSearchSolver< Input, Output, State >::LocalSearchSolver<Input, Output, State> ( StateManager< Input, State > * sm,
OutputManager< Input, Output, State > * om,
Input * in = NULL,
Output * out = NULL ) [protected]
 

Constructs a local search solver by providing it a state manager, an output manager, an input object, and an output object.

Parameters:
sm   a pointer to a compatible state manager
om   a pointer to a compatible output manager
in   a pointer to an input object
out   a pointer to an output object

Definition at line 1644 of file EasyLocalTemplates.cpp.


Member Function Documentation

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::Check ( ) [virtual]
 

Checks wether the object state is consistent with all the related objects.

Reimplemented in easylocal::TokenRingSolver.

Definition at line 1681 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::ComputeCost ( ) [protected]
 

The cost of the internal state is computed by the state manager.

Definition at line 1672 of file EasyLocalTemplates.cpp.

Referenced by easylocal::TokenRingSolver::Run().

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::DeliverOutput ( ) [protected, virtual]
 

The output is delivered by converting the final internal state to an output object by means of the output manager.

Reimplemented from easylocal::Solver.

Definition at line 1657 of file EasyLocalTemplates.cpp.

Referenced by MultiStartSolve(), ReSolve(), and Solve().

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::FindInitialState ( ) [protected, virtual]
 

The initial state is generated by delegating this task to the state manager. The function invokes the SampleState function.

Definition at line 1665 of file EasyLocalTemplates.cpp.

Referenced by MultiStartSolve(), and Solve().

template<class Input, class Output, class State>
fvalue easylocal::LocalSearchSolver< Input, Output, State >::InternalStateCost ( )
 

Returns the cost of the internal state.

Returns:
the cost of the internal state

Definition at line 1631 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::MultiStartSolve ( unsigned int n ) [virtual]
 

Tries multiple runs on different initial states and records the best one.

Parameters:
n   the number of trials

Reimplemented from easylocal::AbstractSolver.

Definition at line 1782 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
unsigned long easylocal::LocalSearchSolver<Input, Output, State>::NumberOfIterations ( ) const [protected, pure virtual]
 

Returns the number of iterations performed in the search.

Reimplemented in easylocal::SimpleLocalSearch, and easylocal::MultiRunnerSolver.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::ReSolve ( ) [virtual]
 

Uses the final state of previous (Re)Solve execution as the initial one This is useful for running on a set of continuously changing instances.

Reimplemented from easylocal::AbstractSolver.

Definition at line 1769 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver<Input, Output, State>::Run ( ) [protected, pure virtual]
 

Lets all the managed runners Go, and then it collects the best state found.

Reimplemented in easylocal::SimpleLocalSearch, easylocal::ComparativeSolver, and easylocal::TokenRingSolver.

Referenced by MultiStartSolve(), ReSolve(), and Solve().

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::SetInitTrials ( int t )
 

Set the number of states which should be tried in the initialization phase.

Definition at line 1610 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::SetInput ( Input * in ) [virtual]
 

Sets the internal input pointer to the new value passed as parameter.

Parameters:
in   the new input.

Reimplemented from easylocal::Solver.

Definition at line 1619 of file EasyLocalTemplates.cpp.

template<class Input, class Output, class State>
void easylocal::LocalSearchSolver< Input, Output, State >::Solve ( ) [virtual]
 

Performs a full solving procedure by finding an initial state, running the attached runner and delivering the output.

Reimplemented from easylocal::Solver.

Definition at line 1757 of file EasyLocalTemplates.cpp.


Member Data Documentation

template<class Input, class Output, class State>
State easylocal::LocalSearchSolver<Input, Output, State>::internal_state [protected]
 

The internal state of the solver.

Definition at line 857 of file EasyLocal.h.

template<class Input, class Output, class State>
fvalue easylocal::LocalSearchSolver<Input, Output, State>::internal_state_cost [protected]
 

The cost of the internal state.

Definition at line 856 of file EasyLocal.h.

template<class Input, class Output, class State>
unsigned int easylocal::LocalSearchSolver<Input, Output, State>::number_of_init_trials [protected]
 

Number of different initial states tested for a run.

Definition at line 858 of file EasyLocal.h.

template<class Input, class Output, class State>
OutputManager< Input, Output, State > * easylocal::LocalSearchSolver<Input, Output, State>::p_om [protected]
 

A pointer to the attached output manager.

Definition at line 854 of file EasyLocal.h.

template<class Input, class Output, class State>
StateManager< Input, State > * easylocal::LocalSearchSolver<Input, Output, State>::p_sm [protected]
 

A pointer to the attached state manager.

Definition at line 852 of file EasyLocal.h.


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