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

The violation of a cumulative is the sum of overloads over time. More...

#include <constraint_violation.h>

Inheritance diagram for operations_research::sat::CompiledCumulativeConstraint:
operations_research::sat::CompiledConstraint

Public Member Functions

 CompiledCumulativeConstraint (const ConstraintProto &ct_proto, const CpModelProto &cp_model)
 --— CompiledCumulativeConstraint --—
 
 ~CompiledCumulativeConstraint () override=default
 
int64_t ComputeViolation (absl::Span< const int64_t > solution) override
 
- Public Member Functions inherited from operations_research::sat::CompiledConstraint
 CompiledConstraint (const ConstraintProto &ct_proto)
 --— CompiledConstraint --—
 
virtual ~CompiledConstraint ()=default
 
void InitializeViolation (absl::Span< const int64_t > solution)
 Recomputes the violation of the constraint from scratch.
 
void PerformMove (int var, int64_t old_value, absl::Span< const int64_t > solution_with_new_value)
 Update the violation with the new value.
 
virtual int64_t ViolationDelta (int var, int64_t old_value, absl::Span< const int64_t > solution_with_new_value)
 Returns the delta if var changes from old_value to solution[var].
 
const ConstraintProto & ct_proto () const
 Getters.
 
int64_t violation () const
 

Detailed Description

The violation of a cumulative is the sum of overloads over time.

Definition at line 523 of file constraint_violation.h.

Constructor & Destructor Documentation

◆ CompiledCumulativeConstraint()

operations_research::sat::CompiledCumulativeConstraint::CompiledCumulativeConstraint ( const ConstraintProto & ct_proto,
const CpModelProto & cp_model )
explicit

--— CompiledCumulativeConstraint --—

Definition at line 1144 of file constraint_violation.cc.

◆ ~CompiledCumulativeConstraint()

operations_research::sat::CompiledCumulativeConstraint::~CompiledCumulativeConstraint ( )
overridedefault

Member Function Documentation

◆ ComputeViolation()

int64_t operations_research::sat::CompiledCumulativeConstraint::ComputeViolation ( absl::Span< const int64_t > solution)
overridevirtual

Computes the violation of a constraint.

A violation is a positive integer value. A zero value means the constraint is not violated.

Implements operations_research::sat::CompiledConstraint.

Definition at line 1148 of file constraint_violation.cc.


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