Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::ReservoirConstraint Class Reference

#include <cp_model.h>

Inheritance diagram for operations_research::sat::ReservoirConstraint:
operations_research::sat::Constraint

Public Member Functions

void AddEvent (LinearExpr time, int64_t level_change)
 
void AddOptionalEvent (LinearExpr time, int64_t level_change, BoolVar is_active)
 
- Public Member Functions inherited from operations_research::sat::Constraint
Constraint OnlyEnforceIf (absl::Span< const BoolVar > literals)
 
Constraint OnlyEnforceIf (BoolVar literal)
 See OnlyEnforceIf(absl::Span<const BoolVar> literals).
 
Constraint WithName (absl::string_view name)
 Sets the name of the constraint.
 
absl::string_view Name () const
 Returns the name of the constraint (or the empty string if not set).
 
const ConstraintProto & Proto () const
 Returns the underlying protobuf object (useful for testing).
 
ConstraintProto * MutableProto () const
 Returns the mutable underlying protobuf object (useful for model edition).
 

Friends

class CpModelBuilder
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::sat::Constraint
 Constraint (ConstraintProto *proto)
 
- Protected Attributes inherited from operations_research::sat::Constraint
ConstraintProto * proto_ = nullptr
 

Detailed Description

Specialized reservoir constraint.

This constraint allows adding emptying/refilling events to the reservoir constraint incrementally.

Definition at line 645 of file cp_model.h.

Member Function Documentation

◆ AddEvent()

void operations_research::sat::ReservoirConstraint::AddEvent ( LinearExpr time,
int64_t level_change )

Adds a mandatory event

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

Definition at line 537 of file cp_model.cc.

◆ AddOptionalEvent()

void operations_research::sat::ReservoirConstraint::AddOptionalEvent ( LinearExpr time,
int64_t level_change,
BoolVar is_active )

Adds an optional event

If is_active is true, It will increase the used capacity by level_change at time time.time` must be an affine expression.

Definition at line 545 of file cp_model.cc.

Friends And Related Symbol Documentation

◆ CpModelBuilder

friend class CpModelBuilder
friend

Definition at line 665 of file cp_model.h.


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