public class ReservoirConstraint extends Constraint
This constraint allows adding events (time, levelChange, isActive (optional)) to the reservoir constraint incrementally.
Constructor and Description |
---|
ReservoirConstraint(CpModel model) |
Modifier and Type | Method and Description |
---|---|
ReservoirConstraint |
addEvent(LinearArgument time,
long levelChange)
Adds a mandatory event
It will increase the used capacity by `levelChange` at time `time`.
|
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`.
|
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`.
|
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`.
|
getBuilder, getIndex, onlyEnforceIf, onlyEnforceIf
public ReservoirConstraint(CpModel model)
public ReservoirConstraint addEvent(LinearArgument time, long levelChange)
It will increase the used capacity by `levelChange` at time `time`. `time` must be an affine expression.
public ReservoirConstraint addEvent(long time, long levelChange)
It will increase the used capacity by `levelChange` at time `time`.
public ReservoirConstraint addOptionalEvent(LinearExpr time, long levelChange, Literal isActive)
If `isActive` is true, It will increase the used capacity by `levelChange` at time `time`. `time` must be an affine expression.
public ReservoirConstraint addOptionalEvent(long time, long levelChange, Literal isActive)
If `isActive` is true, It will increase the used capacity by `levelChange` at time `time`.
Copyright © 2025. All rights reserved.