Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator Class Reference

Detailed Description

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 4249 of file pywrapcp.py.

Inheritance diagram for ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator:
ortools.constraint_solver.pywrapcp.LocalSearchOperator ortools.constraint_solver.pywrapcp.BaseObject ortools.constraint_solver.pywrapcp.BaseLns ortools.constraint_solver.pywrapcp.ChangeValue

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
 __init__ (self, *args, **kwargs)
 __disown__ (self)
Public Member Functions inherited from ortools.constraint_solver.pywrapcp.BaseObject
 __init__ (self)
 DebugString (self)
 __str__ (self)
 __repr__ (self)
 __disown__ (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")

Constructor & Destructor Documentation

◆ __init__()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.__init__ ( self,
vars,
keep_inverse_values = False )

Definition at line 4261 of file pywrapcp.py.

Member Function Documentation

◆ __disown__()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.__disown__ ( self)

Definition at line 4342 of file pywrapcp.py.

◆ Activate()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Activate ( self,
index )

Definition at line 4305 of file pywrapcp.py.

◆ Activated()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Activated ( self,
index )

Definition at line 4302 of file pywrapcp.py.

◆ AddVars()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.AddVars ( self,
vars )

Definition at line 4311 of file pywrapcp.py.

◆ Deactivate()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Deactivate ( self,
index )

Definition at line 4308 of file pywrapcp.py.

◆ IsIncremental()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.IsIncremental ( self)

Definition at line 4276 of file pywrapcp.py.

◆ NextNeighbor()

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 4322 of file pywrapcp.py.

◆ OldValue()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.OldValue ( self,
index )

Definition at line 4293 of file pywrapcp.py.

◆ OneNeighbor()

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 4335 of file pywrapcp.py.

◆ OnStart()

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 4314 of file pywrapcp.py.

◆ PrevValue()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.PrevValue ( self,
index )

Definition at line 4296 of file pywrapcp.py.

◆ SetValue()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.SetValue ( self,
index,
value )

Definition at line 4299 of file pywrapcp.py.

◆ Size()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Size ( self)

Definition at line 4279 of file pywrapcp.py.

◆ Start()

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 4269 of file pywrapcp.py.

◆ Value()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Value ( self,
index )
Returns the value in the current assignment of the variable of given
index.

Definition at line 4282 of file pywrapcp.py.

◆ Var()

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.Var ( self,
index )
Returns the variable of given index.

Definition at line 4289 of file pywrapcp.py.

Property Documentation

◆ thisown

ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator.thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static

Definition at line 4258 of file pywrapcp.py.


The documentation for this class was generated from the following file: