|
Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
easylocal::StateManager Class Template Reference#include <EasyLocal.h>
List of all members. Public Methods
Protected Methods
Protected Attributes
Detailed Description
template<class Input, class State> class easylocal::StateManager
The State Manager is responsible for all operations on the state which are independent of the neighborhood definition, such as generating a random state, and computing the cost of a state. No Move template is supplied to it.
Definition at line 117 of file EasyLocal.h.
Constructor & Destructor Documentation
template<class Input, class State> |
easylocal::StateManager< Input, State >::StateManager<Input, State> (
|
Input * in = NULL ) [protected]
|
|
|
Builds a state manager object linked to the provided input. -
Parameters:
-
in
|
a pointer to an input object |
Definition at line 176 of file EasyLocalTemplates.cpp. |
Member Function Documentation
template<class Input, class State> |
void easylocal::StateManager< Input, State >::Check (
|
) const [virtual]
|
|
|
Checks wether the object state is consistent with all the related objects.
Definition at line 167 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
fvalue easylocal::StateManager< Input, State >::CostFunction (
|
const State & st ) const [virtual]
|
|
|
Evaluates the cost function value in a given state. The tentative definition computes a weighted sum of the violation function and the objective function. -
Parameters:
-
st
|
the state to be evaluated |
-
Returns:
-
the value of the cost function in the given state
Definition at line 99 of file EasyLocalTemplates.cpp.
Referenced by ImprovedSampleState(), PrintState(), and SampleState(). |
template<class Input, class State> |
Input * easylocal::StateManager< Input, State >::GetInput (
|
)
|
|
|
Returns the input pointer which the object is attached to.
-
Returns:
-
the pointer to the input object
Definition at line 159 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
fvalue easylocal::StateManager< Input, State >::ImprovedSampleState (
|
State & st,
|
|
int samples,
|
|
Runner< Input, State > * r ) [virtual]
|
|
|
Looks for the best state out of a given number of states which are obtained by random generation and are improved running a local search algorithm upon them. -
Parameters:
-
st
|
the best state found |
samples
|
the number of sampled states |
r
|
a pointer to a runner to be used to improve the sampled |
Definition at line 61 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
fvalue easylocal::StateManager< Input, State >::Objective (
|
const State & st ) const [virtual]
|
|
|
A tentative definition of the objective function: by default, it simply returns 0 and outputs a warning message. -
Parameters:
-
st
|
the state to be evaluated |
-
Returns:
-
the value of the violations function in the given state
Definition at line 138 of file EasyLocalTemplates.cpp.
Referenced by CostFunction(), and PrintState(). |
template<class Input, class State> |
void easylocal::StateManager< Input, State >::PrintState (
|
const State & st ) const [virtual]
|
|
|
Outputs some informations about the state passed as parameter. -
Parameters:
-
st
|
the state to be inspected |
Definition at line 108 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
void easylocal::StateManager<Input, State>::RandomState (
|
State & st ) [pure virtual]
|
|
template<class Input, class State> |
fvalue easylocal::StateManager< Input, State >::SampleState (
|
State & st,
|
|
int samples ) [virtual]
|
|
|
Looks for the best state out of a given number of sampled states. -
Parameters:
-
st
|
the best state found |
samples
|
the number of sampled states |
Definition at line 29 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
void easylocal::StateManager< Input, State >::SetInput (
|
Input * in )
|
|
|
Sets the internal input pointer to the new value passed as parameter. -
Parameters:
-
Definition at line 150 of file EasyLocalTemplates.cpp. |
template<class Input, class State> |
void easylocal::StateManager<Input, State>::UpdateRedundantStateData (
|
State & st ) [inline, virtual]
|
|
|
Possibly updates redundant state data. It is used by the output manager to make the state consistent. -
Parameters:
-
st
|
the state to be updated |
Definition at line 128 of file EasyLocal.h. |
template<class Input, class State> |
fvalue easylocal::StateManager< Input, State >::Violations (
|
const State & st ) const [virtual]
|
|
|
A tentative definition of the violation function: by default, it simply returns 0 and outputs a warning message. -
Parameters:
-
st
|
the state to be evaluated |
-
Returns:
-
the value of the violations function in the given state
Definition at line 124 of file EasyLocalTemplates.cpp.
Referenced by CostFunction(), and PrintState(). |
Member Data Documentation
template<class Input, class State> |
Input * easylocal::StateManager<Input, State>::p_in [protected]
|
|
|
A pointer to the input object.
Definition at line 146 of file EasyLocal.h. |
The documentation for this class was generated from the following files:
|