![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
The class Iterator has two direct subclasses. HoleIterators
iterates over all holes, that is value removed between the
current min and max of the variable since the last time the
variable was processed in the queue. DomainIterators iterates
over all elements of the variable domain. Both iterators are not
robust to domain changes. Hole iterators can also report values outside
the current min and max of the variable.
HoleIterators should only be called from a demon attached to the
variable that has created this iterator.
IntVar* current_var;
std::unique_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false));
for (const int64_t hole : InitAndGetValues(it)) {
use the hole
}
Definition at line 2751 of file pywrapcp.py.
Public Member Functions | |
| __init__ (self, *args, **kwargs) | |
| Init (self) | |
| Ok (self) | |
| Value (self) | |
| Next (self) | |
| DebugString (self) | |
| __iter__ (self) | |
| next (self) | |
| __next__ (self) | |
| Public Member Functions inherited from ortools.constraint_solver.pywrapcp.BaseObject | |
| __init__ (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.BaseObject | |
| thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
| ortools.constraint_solver.pywrapcp.IntVarIterator.__init__ | ( | self, | |
| * | args, | ||
| ** | kwargs ) |
Definition at line 2771 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.__iter__ | ( | self | ) |
Definition at line 2795 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.__next__ | ( | self | ) |
Definition at line 2807 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.DebugString | ( | self | ) |
Pretty Print.
Reimplemented from ortools.constraint_solver.pywrapcp.BaseObject.
Definition at line 2791 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.Init | ( | self | ) |
This method must be called before each loop.
Definition at line 2775 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.Next | ( | self | ) |
This method moves the iterator to the next value.
Definition at line 2787 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.next | ( | self | ) |
Definition at line 2799 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.Ok | ( | self | ) |
This method indicates if we can call Value() or not.
Definition at line 2779 of file pywrapcp.py.
| ortools.constraint_solver.pywrapcp.IntVarIterator.Value | ( | self | ) |
This method returns the current value of the iterator.
Definition at line 2783 of file pywrapcp.py.
|
static |
Definition at line 2769 of file pywrapcp.py.