1 #if !defined(_DELTA_COST_COMPONENT_HH_)
2 #define _DELTA_COST_COMPONENT_HH_
16 template <
class Input,
class State,
class Move,
typename CFtype =
int>
27 virtual void Print(std::ostream& os = std::cout)
const;
39 virtual CFtype
DeltaCost(
const State& st,
const Move& mv)
const;
82 template <
class Input,
class State,
class Move,
typename CFtype>
84 : name(name), in(i), cc(e_cc)
87 template <
class Input,
class State,
class Move,
typename CFtype>
90 os <<
" DeltaCost Component: " + this->name << std::endl;
93 template <
class Input,
class State,
class Move,
typename CFtype>
97 return this->cc.Weight() * ComputeDeltaCost(st, mv);
100 template <
class Input,
class State,
class Move,
typename CFtype>
106 template <
class Input,
class State,
class Move,
typename CFtype =
int>
129 template <
class Input,
class State,
class Move,
typename CFtype>
130 DeltaCostComponentAdapter<Input, State, Move, CFtype>::DeltaCostComponentAdapter(
const Input& in,
CostComponent<Input, State, CFtype>& cc,
NeighborhoodExplorer<Input, State, Move, CFtype>& ne)
131 :
DeltaCostComponent<Input, State, Move, CFtype>(in, cc,
"DeltaAdapter" + cc.name), ne(ne)
136 #endif // _DELTA_COST_COMPONENT_HH_
DeltaCostComponentAdapter(const Input &in, CostComponent< Input, State, CFtype > &cc, NeighborhoodExplorer< Input, State, Move, CFtype > &ne)
NeighborhoodExplorer< Input, State, Move, CFtype > & ne
virtual CFtype DeltaCost(const State &st, const Move &mv) const
virtual void Print(std::ostream &os=std::cout) const
virtual bool IsDeltaImplemented() const
CostComponent< Input, State, CFtype > & GetCostComponent() const
virtual CFtype ComputeCost(const State &st) const =0
DeltaCostComponent(const Input &in, CostComponent< Input, State, CFtype > &cc, std::string name)
Constructs a DeltaCostComponent providing an input object, the related CostComponent and a name...
virtual CFtype ComputeDeltaCost(const State &st, const Move &mv) const =0
virtual bool IsDeltaImplemented() const
virtual void MakeMove(State &st, const Move &mv) const =0
The class CostComponent manages one single component of the cost, either hard or soft.
CostComponent< Input, State, CFtype > & cc
virtual CFtype ComputeDeltaCost(const State &st, const Move &mv) const