Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
__init__ (self, vars, keep_inverse_values=False) | |
Start (self, assignment) | |
IsIncremental (self) | |
Size (self) | |
Value (self, index) | |
Var (self, index) | |
OldValue (self, index) | |
PrevValue (self, index) | |
SetValue (self, index, value) | |
Activated (self, index) | |
Activate (self, index) | |
Deactivate (self, index) | |
AddVars (self, vars) | |
OnStart (self) | |
NextNeighbor (self, delta, deltadelta) | |
OneNeighbor (self) | |
__disown__ (self) | |
Public Member Functions inherited from ortools.constraint_solver.pywrapcp.LocalSearchOperator | |
Public Member Functions inherited from ortools.constraint_solver.pywrapcp.BaseObject | |
DebugString (self) | |
__str__ (self) | |
__repr__ (self) | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
Properties inherited from ortools.constraint_solver.pywrapcp.LocalSearchOperator | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
Properties inherited from ortools.constraint_solver.pywrapcp.BaseObject | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
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 3991 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.__init__ | ( | self, | |
vars, | |||
keep_inverse_values = False ) |
Reimplemented from ortools.constraint_solver.pywrapcp.LocalSearchOperator.
Reimplemented in ortools.constraint_solver.pywrapcp.BaseLns, ortools.constraint_solver.pywrapcp.ChangeValue, and ortools.constraint_solver.pywrapcp.PathOperator.
Definition at line 4003 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.__disown__ | ( | self | ) |
Reimplemented from ortools.constraint_solver.pywrapcp.LocalSearchOperator.
Reimplemented in ortools.constraint_solver.pywrapcp.BaseLns, and ortools.constraint_solver.pywrapcp.ChangeValue.
Definition at line 4084 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Activate | ( | self, | |
index ) |
Definition at line 4047 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Activated | ( | self, | |
index ) |
Definition at line 4044 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.AddVars | ( | self, | |
vars ) |
Definition at line 4053 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Deactivate | ( | self, | |
index ) |
Definition at line 4050 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.IsIncremental | ( | self | ) |
Definition at line 4018 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.NextNeighbor | ( | self, | |
delta, | |||
deltadelta ) |
OnStart() should really be protected, but then SWIG doesn't see it. So we make it public, but only subclasses should access to it (to override it). 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.
Reimplemented from ortools.constraint_solver.pywrapcp.LocalSearchOperator.
Definition at line 4064 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.OldValue | ( | self, | |
index ) |
Definition at line 4035 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.OneNeighbor | ( | self | ) |
Creates a new neighbor. It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator.
Reimplemented in ortools.constraint_solver.pywrapcp.ChangeValue.
Definition at line 4077 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.OnStart | ( | self | ) |
Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling IntVarLocalSearchOperator::Start explicitly.
Definition at line 4056 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.PrevValue | ( | self, | |
index ) |
Definition at line 4038 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.SetValue | ( | self, | |
index, | |||
value ) |
Definition at line 4041 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Size | ( | self | ) |
Definition at line 4021 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Start | ( | self, | |
assignment ) |
This method should not be overridden. Override OnStart() instead which is called before exiting this method.
Reimplemented from ortools.constraint_solver.pywrapcp.LocalSearchOperator.
Definition at line 4011 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Value | ( | self, | |
index ) |
Returns the value in the current assignment of the variable of given index.
Definition at line 4024 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Var | ( | self, | |
index ) |
Returns the variable of given index.
Definition at line 4031 of file pywrapcp.py.
|
static |
Definition at line 4000 of file pywrapcp.py.