Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
|
The violation of a cumulative is the sum of overloads over time. More...
#include <constraint_violation.h>
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 |
The violation of a cumulative is the sum of overloads over time.
Definition at line 523 of file constraint_violation.h.
|
explicit |
--— CompiledCumulativeConstraint --—
Definition at line 1144 of file constraint_violation.cc.
|
overridedefault |
|
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.