![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
__init__ (self, vars) | |
InitFragments (self) | |
NextFragment (self) | |
AppendToFragment (self, index) | |
FragmentSize (self) | |
__getitem__ (self, index) | |
__len__ (self) | |
__disown__ (self) | |
![]() | |
__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) | |
![]() | |
__init__ (self, *args, **kwargs) | |
__disown__ (self) | |
![]() | |
__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") | |
![]() | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
![]() | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
![]() | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
This is the base class for building an Lns operator. An Lns fragment is a collection of variables which will be relaxed. Fragments are built with NextFragment(), which returns false if there are no more fragments to build. Optionally one can override InitFragments, which is called from LocalSearchOperator::Start to initialize fragment data. Here's a sample relaxing one variable at a time: class OneVarLns : public BaseLns { public: OneVarLns(const std::vector<IntVar*>& vars) : BaseLns(vars), index_(0) {} virtual ~OneVarLns() {} virtual void InitFragments() { index_ = 0; } virtual bool NextFragment() { const int size = Size(); if (index_ < size) { AppendToFragment(index_); ++index_; return true; } else { return false; } } private: int index_; };
Definition at line 4331 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.__init__ | ( | self, | |
vars ) |
Definition at line 4365 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.__disown__ | ( | self | ) |
Definition at line 4390 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.__getitem__ | ( | self, | |
index ) |
Definition at line 4385 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.__len__ | ( | self | ) |
Definition at line 4388 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.AppendToFragment | ( | self, | |
index ) |
Definition at line 4379 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.FragmentSize | ( | self | ) |
Definition at line 4382 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.InitFragments | ( | self | ) |
Definition at line 4373 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.BaseLns.NextFragment | ( | self | ) |
Definition at line 4376 of file pywrapcp.py.
|
static |
Definition at line 4362 of file pywrapcp.py.