Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.sat.python.cp_model.IntervalVar Class Reference

Public Member Functions

None __init__ (self, cp_model_pb2.CpModelProto model, VariableList var_list, Union[cp_model_pb2.LinearExpressionProto, int] start, Optional[cp_model_pb2.LinearExpressionProto] size, Optional[cp_model_pb2.LinearExpressionProto] end, Optional[int] is_present_index, Optional[str] name)
 
int index (self)
 
cp_model_pb2.IntervalConstraintProto proto (self)
 
 __str__ (self)
 
 __repr__ (self)
 
str name (self)
 
LinearExprT start_expr (self)
 
LinearExprT size_expr (self)
 
LinearExprT end_expr (self)
 
str Name (self)
 
int Index (self)
 
cp_model_pb2.IntervalConstraintProto Proto (self)
 

Static Public Attributes

LinearExprT StartExpr = start_expr
 
LinearExprT SizeExpr = size_expr
 
LinearExprT EndExpr = end_expr
 

Detailed Description

Represents an Interval variable.

An interval variable is both a constraint and a variable. It is defined by
three integer variables: start, size, and end.

It is a constraint because, internally, it enforces that start + size == end.

It is also a variable as it can appear in specific scheduling constraints:
NoOverlap, NoOverlap2D, Cumulative.

Optionally, an enforcement literal can be added to this constraint, in which
case these scheduling constraints will ignore interval variables with
enforcement literals assigned to false. Conversely, these constraints will
also set these enforcement literals to false if they cannot fit these
intervals into the schedule.

Raises:
  ValueError: if start, size, end are not defined, or have the wrong type.

Definition at line 462 of file cp_model.py.

Constructor & Destructor Documentation

◆ __init__()

None ortools.sat.python.cp_model.IntervalVar.__init__ ( self,
cp_model_pb2.CpModelProto model,
VariableList var_list,
Union[cp_model_pb2.LinearExpressionProto, int] start,
Optional[cp_model_pb2.LinearExpressionProto] size,
Optional[cp_model_pb2.LinearExpressionProto] end,
Optional[int] is_present_index,
Optional[str] name )

Definition at line 483 of file cp_model.py.

Member Function Documentation

◆ __repr__()

ortools.sat.python.cp_model.IntervalVar.__repr__ ( self)

Definition at line 543 of file cp_model.py.

◆ __str__()

ortools.sat.python.cp_model.IntervalVar.__str__ ( self)

Definition at line 540 of file cp_model.py.

◆ end_expr()

LinearExprT ortools.sat.python.cp_model.IntervalVar.end_expr ( self)

Definition at line 573 of file cp_model.py.

◆ Index()

int ortools.sat.python.cp_model.IntervalVar.Index ( self)

Definition at line 581 of file cp_model.py.

◆ index()

int ortools.sat.python.cp_model.IntervalVar.index ( self)
Returns the index of the interval constraint in the model.

Definition at line 531 of file cp_model.py.

◆ Name()

str ortools.sat.python.cp_model.IntervalVar.Name ( self)

Definition at line 578 of file cp_model.py.

◆ name()

str ortools.sat.python.cp_model.IntervalVar.name ( self)

Definition at line 562 of file cp_model.py.

◆ Proto()

cp_model_pb2.IntervalConstraintProto ortools.sat.python.cp_model.IntervalVar.Proto ( self)

Definition at line 584 of file cp_model.py.

◆ proto()

cp_model_pb2.IntervalConstraintProto ortools.sat.python.cp_model.IntervalVar.proto ( self)
Returns the interval protobuf.

Definition at line 536 of file cp_model.py.

◆ size_expr()

LinearExprT ortools.sat.python.cp_model.IntervalVar.size_expr ( self)

Definition at line 570 of file cp_model.py.

◆ start_expr()

LinearExprT ortools.sat.python.cp_model.IntervalVar.start_expr ( self)

Definition at line 567 of file cp_model.py.

Member Data Documentation

◆ EndExpr

LinearExprT ortools.sat.python.cp_model.IntervalVar.EndExpr = end_expr
static

Definition at line 589 of file cp_model.py.

◆ SizeExpr

LinearExprT ortools.sat.python.cp_model.IntervalVar.SizeExpr = size_expr
static

Definition at line 588 of file cp_model.py.

◆ StartExpr

LinearExprT ortools.sat.python.cp_model.IntervalVar.StartExpr = start_expr
static

Definition at line 587 of file cp_model.py.


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