Package com.google.ortools.sat
Class ReservoirConstraint
- java.lang.Object
-
- com.google.ortools.sat.Constraint
-
- com.google.ortools.sat.ReservoirConstraint
-
public class ReservoirConstraint extends Constraint
Specialized reservoir constraint.This constraint allows adding events (time, levelChange, isActive (optional)) to the reservoir constraint incrementally.
-
-
Constructor Summary
Constructors Constructor Description ReservoirConstraint(CpModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReservoirConstraintaddEvent(long time, long levelChange)Adds a mandatory event at a fixed timeReservoirConstraintaddEvent(LinearArgument time, long levelChange)Adds a mandatory eventReservoirConstraintaddOptionalEvent(long time, long levelChange, Literal isActive)Adds an optional event at a fixed timeReservoirConstraintaddOptionalEvent(LinearExpr time, long levelChange, Literal isActive)Adds an optional event-
Methods inherited from class com.google.ortools.sat.Constraint
getBuilder, getIndex, onlyEnforceIf, onlyEnforceIf
-
-
-
-
Constructor Detail
-
ReservoirConstraint
public ReservoirConstraint(CpModel model)
-
-
Method Detail
-
addEvent
public ReservoirConstraint addEvent(LinearArgument time, long levelChange)
Adds a mandatory eventIt will increase the used capacity by `levelChange` at time `time`. `time` must be an affine expression.
-
addEvent
public ReservoirConstraint addEvent(long time, long levelChange)
Adds a mandatory event at a fixed timeIt will increase the used capacity by `levelChange` at time `time`.
-
addOptionalEvent
public ReservoirConstraint addOptionalEvent(LinearExpr time, long levelChange, Literal isActive)
Adds an optional eventIf `isActive` is true, It will increase the used capacity by `levelChange` at time `time`. `time` must be an affine expression.
-
addOptionalEvent
public ReservoirConstraint addOptionalEvent(long time, long levelChange, Literal isActive)
Adds an optional event at a fixed timeIf `isActive` is true, It will increase the used capacity by `levelChange` at time `time`.
-
-