Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.constraint_solver.pywrapcp.IntVarLocalSearchOperator Class Reference
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")
 

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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 4243 of file pywrapcp.py.

Member Function Documentation

◆ __disown__()

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

Definition at line 4324 of file pywrapcp.py.

◆ Activate()

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

Definition at line 4287 of file pywrapcp.py.

◆ Activated()

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

Definition at line 4284 of file pywrapcp.py.

◆ AddVars()

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

Definition at line 4293 of file pywrapcp.py.

◆ Deactivate()

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

Definition at line 4290 of file pywrapcp.py.

◆ IsIncremental()

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

Definition at line 4258 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 4304 of file pywrapcp.py.

◆ OldValue()

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

Definition at line 4275 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 4317 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 4296 of file pywrapcp.py.

◆ PrevValue()

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

Definition at line 4278 of file pywrapcp.py.

◆ SetValue()

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

Definition at line 4281 of file pywrapcp.py.

◆ Size()

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

Definition at line 4261 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 4251 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 4264 of file pywrapcp.py.

◆ Var()

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

Definition at line 4271 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 4240 of file pywrapcp.py.


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