Java Reference

Java Reference

Detailed Description

Specialized cumulative constraint.

This constraint allows adding (interval, demand) pairs to the cumulative constraint incrementally.

Definition at line 24 of file CumulativeConstraint.java.

Public Member Functions

 CumulativeConstraint (CpModel model)
 
CumulativeConstraint addDemand (IntervalVar interval, LinearArgument demand)
 Adds a pair (interval, demand) to the constraint. More...
 
CumulativeConstraint addDemand (IntervalVar interval, long demand)
 Adds a pair (interval, demand) to the constraint. More...
 
CumulativeConstraint addDemands (IntervalVar[] intervals, LinearArgument[] demands)
 Adds all pairs (intervals[i], demands[i]) to the constraint. More...
 
CumulativeConstraint addDemands (IntervalVar[] intervals, long[] demands)
 Adds all pairs (intervals[i], demands[i]) to the constraint. More...
 
CumulativeConstraint addDemands (IntervalVar[] intervals, int[] demands)
 Adds all pairs (intervals[i], demands[i]) to the constraint. More...
 
void onlyEnforceIf (Literal lit)
 Adds a literal to the constraint. More...
 
void onlyEnforceIf (Literal[] lits)
 Adds a list of literals to the constraint. More...
 
int getIndex ()
 Returns the index of the constraint in the model. More...
 
ConstraintProto.Builder getBuilder ()
 Returns the constraint builder. More...
 

Constructor & Destructor Documentation

◆ CumulativeConstraint()

Definition at line 25 of file CumulativeConstraint.java.

Member Function Documentation

◆ addDemand() [1/2]

CumulativeConstraint addDemand ( IntervalVar  interval,
LinearArgument  demand 
)

Adds a pair (interval, demand) to the constraint.

Definition at line 31 of file CumulativeConstraint.java.

◆ addDemand() [2/2]

CumulativeConstraint addDemand ( IntervalVar  interval,
long  demand 
)

Adds a pair (interval, demand) to the constraint.

Definition at line 39 of file CumulativeConstraint.java.

◆ addDemands() [1/3]

CumulativeConstraint addDemands ( IntervalVar[]  intervals,
int[]  demands 
)

Adds all pairs (intervals[i], demands[i]) to the constraint.

Parameters
intervalsan array of interval variables
deamdsan array of integer values
Returns
itself
Exceptions
CpModel.MismatchedArrayLengthsif intervals and demands have different length

Definition at line 92 of file CumulativeConstraint.java.

◆ addDemands() [2/3]

CumulativeConstraint addDemands ( IntervalVar[]  intervals,
LinearArgument[]  demands 
)

Adds all pairs (intervals[i], demands[i]) to the constraint.

Parameters
intervalsan array of interval variables
deamdsan array of linear expression
Returns
itself
Exceptions
CpModel.MismatchedArrayLengthsif intervals and demands have different length

Definition at line 54 of file CumulativeConstraint.java.

◆ addDemands() [3/3]

CumulativeConstraint addDemands ( IntervalVar[]  intervals,
long[]  demands 
)

Adds all pairs (intervals[i], demands[i]) to the constraint.

Parameters
intervalsan array of interval variables
deamdsan array of long values
Returns
itself
Exceptions
CpModel.MismatchedArrayLengthsif intervals and demands have different length

Definition at line 73 of file CumulativeConstraint.java.

◆ getBuilder()

ConstraintProto.Builder getBuilder ( )
inherited

Returns the constraint builder.

Definition at line 49 of file Constraint.java.

◆ getIndex()

int getIndex ( )
inherited

Returns the index of the constraint in the model.

Definition at line 44 of file Constraint.java.

◆ onlyEnforceIf() [1/2]

void onlyEnforceIf ( Literal  lit)
inherited

Adds a literal to the constraint.

Definition at line 32 of file Constraint.java.

◆ onlyEnforceIf() [2/2]

void onlyEnforceIf ( Literal[]  lits)
inherited

Adds a list of literals to the constraint.

Definition at line 37 of file Constraint.java.


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