Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
// doxy/ or-tools/ src/ constraint_solver/ |
#include <constraint_solveri.h>
Public Member Functions | |
IntVarLocalSearchOperator () | |
Base operator class for operators manipulating IntVars. | |
IntVarLocalSearchOperator (const IntVar *const *vars, int size) | |
virtual | ~IntVarLocalSearchOperator () |
virtual void | Start (const Assignment *assignment) |
This method should not be overridden. | |
virtual bool | IsIncremental () const |
int | Size () const |
int64 | Value (int64 index) const |
Returns the value in the current assignment of the variable of given index. | |
IntVar * | Var (int64 index) const |
Returns the variable of given index. | |
virtual bool | SkipUnchanged (int index) const |
virtual bool | MakeNextNeighbor (Assignment *delta, Assignment *deltadelta) |
Redefines MakeNextNeighbor to export a simpler interface. | |
Protected Member Functions | |
virtual bool | MakeOneNeighbor () |
Creates a new neighbor. | |
int64 | OldValue (int64 index) const |
void | SetValue (int64 index, int64 value) |
bool | Activated (int64 index) const |
void | Activate (int64 index) |
void | Deactivate (int64 index) |
bool | ApplyChanges (Assignment *delta, Assignment *deltadelta) const |
void | RevertChanges (bool incremental) |
void | AddVars (const IntVar *const *vars, int size) |
Specialization of LocalSearchOperator built from an array of IntVars which specifies the scope of the operator. This class also takes care of storing current variable values in Start(), keeps track of changes done by the operator and builds the delta. The Deactivate() method can be used to perform Large Neighborhood Search.
Definition at line 811 of file constraint_solveri.h.
operations_research::IntVarLocalSearchOperator::IntVarLocalSearchOperator | ( | ) |
Base operator class for operators manipulating IntVars.
Definition at line 67 of file local_search.cc.
operations_research::IntVarLocalSearchOperator::IntVarLocalSearchOperator | ( | const IntVar *const * | vars, | |
int | size | |||
) |
Definition at line 78 of file local_search.cc.
operations_research::IntVarLocalSearchOperator::~IntVarLocalSearchOperator | ( | ) | [virtual] |
Definition at line 93 of file local_search.cc.
void operations_research::IntVarLocalSearchOperator::Start | ( | const Assignment * | assignment | ) | [virtual] |
This method should not be overridden.
Override OnStart() instead which is called before exiting this method.
Implements operations_research::LocalSearchOperator.
Definition at line 114 of file local_search.cc.
virtual bool operations_research::IntVarLocalSearchOperator::IsIncremental | ( | ) | const [inline, virtual] |
Definition at line 819 of file constraint_solveri.h.
int operations_research::IntVarLocalSearchOperator::Size | ( | ) | const [inline] |
Definition at line 820 of file constraint_solveri.h.
int64 operations_research::IntVarLocalSearchOperator::Value | ( | int64 | index | ) | const [inline] |
Returns the value in the current assignment of the variable of given index.
Definition at line 822 of file constraint_solveri.h.
IntVar* operations_research::IntVarLocalSearchOperator::Var | ( | int64 | index | ) | const [inline] |
virtual bool operations_research::IntVarLocalSearchOperator::SkipUnchanged | ( | int | index | ) | const [inline, virtual] |
Reimplemented in operations_research::PathOperator.
Definition at line 828 of file constraint_solveri.h.
bool operations_research::IntVarLocalSearchOperator::MakeNextNeighbor | ( | Assignment * | delta, | |
Assignment * | deltadelta | |||
) | [virtual] |
Redefines MakeNextNeighbor to export a simpler interface.
The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead.
Implements operations_research::LocalSearchOperator.
Reimplemented in operations_research::MakePairActiveOperator.
Definition at line 202 of file local_search.cc.
bool operations_research::IntVarLocalSearchOperator::MakeOneNeighbor | ( | ) | [protected, virtual] |
Creates a new neighbor.
It returns false when the neighborhood is completely explored.
Reimplemented in operations_research::BaseLNS, operations_research::ChangeValue, and operations_research::PathOperator.
Definition at line 220 of file local_search.cc.
int64 operations_research::IntVarLocalSearchOperator::OldValue | ( | int64 | index | ) | const [inline, protected] |
Definition at line 845 of file constraint_solveri.h.
void operations_research::IntVarLocalSearchOperator::SetValue | ( | int64 | index, | |
int64 | value | |||
) | [protected] |
Definition at line 137 of file local_search.cc.
bool operations_research::IntVarLocalSearchOperator::Activated | ( | int64 | index | ) | const [protected] |
Definition at line 142 of file local_search.cc.
void operations_research::IntVarLocalSearchOperator::Activate | ( | int64 | index | ) | [protected] |
Definition at line 146 of file local_search.cc.
void operations_research::IntVarLocalSearchOperator::Deactivate | ( | int64 | index | ) | [protected] |
Definition at line 151 of file local_search.cc.
bool operations_research::IntVarLocalSearchOperator::ApplyChanges | ( | Assignment * | delta, | |
Assignment * | deltadelta | |||
) | const [protected] |
Definition at line 156 of file local_search.cc.
void operations_research::IntVarLocalSearchOperator::RevertChanges | ( | bool | incremental | ) | [protected] |
Definition at line 178 of file local_search.cc.
void operations_research::IntVarLocalSearchOperator::AddVars | ( | const IntVar *const * | vars, | |
int | size | |||
) | [protected] |
Definition at line 95 of file local_search.cc.