Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.constraint_solver.pywrapcp.IntVarIterator Class Reference
Inheritance diagram for ortools.constraint_solver.pywrapcp.IntVarIterator:
ortools.constraint_solver.pywrapcp.BaseObject

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
 __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")
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

ortools.constraint_solver.pywrapcp.IntVarIterator.__init__ ( self,
* args,
** kwargs )

Reimplemented from ortools.constraint_solver.pywrapcp.BaseObject.

Definition at line 2519 of file pywrapcp.py.

Member Function Documentation

◆ __iter__()

ortools.constraint_solver.pywrapcp.IntVarIterator.__iter__ ( self)

Definition at line 2543 of file pywrapcp.py.

◆ __next__()

ortools.constraint_solver.pywrapcp.IntVarIterator.__next__ ( self)

Definition at line 2555 of file pywrapcp.py.

◆ DebugString()

ortools.constraint_solver.pywrapcp.IntVarIterator.DebugString ( self)
 Pretty Print.

Reimplemented from ortools.constraint_solver.pywrapcp.BaseObject.

Definition at line 2539 of file pywrapcp.py.

◆ Init()

ortools.constraint_solver.pywrapcp.IntVarIterator.Init ( self)
 This method must be called before each loop.

Definition at line 2523 of file pywrapcp.py.

◆ Next()

ortools.constraint_solver.pywrapcp.IntVarIterator.Next ( self)
 This method moves the iterator to the next value.

Definition at line 2535 of file pywrapcp.py.

◆ next()

ortools.constraint_solver.pywrapcp.IntVarIterator.next ( self)

Definition at line 2547 of file pywrapcp.py.

◆ Ok()

ortools.constraint_solver.pywrapcp.IntVarIterator.Ok ( self)
 This method indicates if we can call Value() or not.

Definition at line 2527 of file pywrapcp.py.

◆ Value()

ortools.constraint_solver.pywrapcp.IntVarIterator.Value ( self)
 This method returns the current value of the iterator.

Definition at line 2531 of file pywrapcp.py.

Property Documentation

◆ thisown

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

Definition at line 2517 of file pywrapcp.py.


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