1 #if !defined(_MOVE_RUNNER_HH_)
2 #define _MOVE_RUNNER_HH_
7 #include <boost/signals2.hpp>
18 template <
class Input,
class State,
class Move,
typename CFtype =
int>
29 template <
typename Observer>
32 for (
unsigned char i = 0; i <
events; i++)
33 if (observer.events() & (1 << i))
40 for (
unsigned char i = 0; i <
events; i++)
50 virtual size_t Modality()
const {
return ne.Modality(); }
52 virtual std::string
StatusString()
const {
return std::string(
"[no status info]"); }
91 template <class Input, class State, class Move, typename CFtype>
92 void LocalSearch<Input, State, Move, CFtype>::UpdateBestState()
109 template <
class Input,
class State,
class Move,
typename CFtype>
118 template <
class Input,
class State,
class Move,
typename CFtype>
124 template <
class Input,
class State,
class Move,
typename CFtype>
130 template <
class Input,
class State,
class Move,
typename CFtype>
133 this->no_acceptable_move_found = !this->current_move.is_valid;
134 return this->current_move.is_valid;
140 template <
class Input,
class State,
class Move,
typename CFtype>
143 if (current_move.is_valid)
145 ne.MakeMove(*this->p_current_state, current_move.move);
146 this->current_state_cost += current_move.cost;
virtual void TerminateRun()
bool LessThan(CFtype value1, CFtype value2)
EvaluatedMove< Move, CFtype > current_move
unsigned long int iteration_of_best
virtual void InitializeRun()
virtual size_t Modality() const
bool EqualTo(CFtype value1, CFtype value2)
virtual bool AcceptableMoveFound()
std::vector< boost::signals2::signal< void(Event event, CostStructure< CFtype > current_state_cost, const EvaluatedMove< Move, CFtype > &em, const std::string &status_string)> > observers
unsigned long int iteration
std::shared_ptr< State > p_current_state
CostStructure< CFtype > current_state_cost
NeighborhoodExplorer< Input, State, Move, CFtype > & ne
const std::string description
LocalSearch(const Input &in, StateManager< Input, State, CFtype > &e_sm, NeighborhoodExplorer< Input, State, Move, CFtype > &e_ne, std::string name, std::string description)
void notify(Event event) const
void registerObserver(Observer &&observer)
std::shared_ptr< State > p_best_state
This component is responsible for all operations on the state which are independent of the neighborho...
virtual std::string StatusString() const
CostStructure< CFtype > best_state_cost