Java Reference

Java Reference

Detailed Description

Specialized reservoir constraint.

This constraint allows adding events (time, levelChange, isActive (optional)) to the reservoir constraint incrementally.

Definition at line 24 of file ReservoirConstraint.java.

Public Member Functions

 ReservoirConstraint (CpModel model)
 
ReservoirConstraint addEvent (LinearArgument time, long levelChange)
 Adds a mandatory event. More...
 
ReservoirConstraint addEvent (long time, long levelChange)
 Adds a mandatory event at a fixed time. More...
 
ReservoirConstraint addOptionalEvent (LinearExpr time, long levelChange, Literal isActive)
 Adds an optional event. More...
 
ReservoirConstraint addOptionalEvent (long time, long levelChange, Literal isActive)
 Adds an optional event at a fixed time. 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

◆ ReservoirConstraint()

Definition at line 25 of file ReservoirConstraint.java.

Member Function Documentation

◆ addEvent() [1/2]

ReservoirConstraint addEvent ( LinearArgument  time,
long  levelChange 
)

Adds a mandatory event.

It will increase the used capacity by levelChange at time time. time must be an affine expression.

Definition at line 36 of file ReservoirConstraint.java.

◆ addEvent() [2/2]

ReservoirConstraint addEvent ( long  time,
long  levelChange 
)

Adds a mandatory event at a fixed time.

It will increase the used capacity by levelChange at time time.

Definition at line 50 of file ReservoirConstraint.java.

◆ addOptionalEvent() [1/2]

ReservoirConstraint addOptionalEvent ( LinearExpr  time,
long  levelChange,
Literal  isActive 
)

Adds an optional event.

If isActive is true, It will increase the used capacity by levelChange at time time. time must be an affine expression.

Definition at line 64 of file ReservoirConstraint.java.

◆ addOptionalEvent() [2/2]

ReservoirConstraint addOptionalEvent ( long  time,
long  levelChange,
Literal  isActive 
)

Adds an optional event at a fixed time.

If isActive is true, It will increase the used capacity by levelChange at time time.

Definition at line 78 of file ReservoirConstraint.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: