Class ReservoirConstraint


  • public class ReservoirConstraint
    extends Constraint
    Specialized reservoir constraint.

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

    • Constructor Detail

      • ReservoirConstraint

        public ReservoirConstraint​(CpModel model)
    • Method Detail

      • addEvent

        public 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.

      • addEvent

        public 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`.

      • addOptionalEvent

        public 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.

      • addOptionalEvent

        public 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`.