Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <cumulative_energy.h>
Public Member Functions | |
CumulativeIsAfterSubsetConstraint (IntegerVariable var, AffineExpression capacity, const std::vector< int > &subtasks, absl::Span< const IntegerValue > offsets, SchedulingConstraintHelper *helper, SchedulingDemandHelper *demands, Model *model) | |
bool | Propagate () final |
void | RegisterWith (GenericLiteralWatcher *watcher) |
Public Member Functions inherited from operations_research::sat::PropagatorInterface | |
PropagatorInterface ()=default | |
virtual | ~PropagatorInterface ()=default |
virtual bool | IncrementalPropagate (const std::vector< int > &) |
Given that the "tasks" are part of a cumulative constraint, this adds a constraint that propagate the fact that: var >= max(end of substasks) + offset.
Definition at line 91 of file cumulative_energy.h.
operations_research::sat::CumulativeIsAfterSubsetConstraint::CumulativeIsAfterSubsetConstraint | ( | IntegerVariable | var, |
AffineExpression | capacity, | ||
const std::vector< int > & | subtasks, | ||
absl::Span< const IntegerValue > | offsets, | ||
SchedulingConstraintHelper * | helper, | ||
SchedulingDemandHelper * | demands, | ||
Model * | model ) |
Definition at line 240 of file cumulative_energy.cc.
|
finalvirtual |
This will be called after one or more literals that are watched by this propagator changed. It will also always be called on the first propagation cycle after registration.
If the capacity_max is low enough, we compute the exact possible subset of reachable "sum of demands" of all tasks used in the energy. We will use the highest reachable as the capacity max.
We consider the energy after a given time. From that we derive a bound on the end_min of the subtasks.
Skip tasks not relevant for this propagator.
Any newly introduced tasks will only change the reachable capa max or the min_offset on the next time point.
Skip tasks not relevant for this propagator.
We prefer higher time in case of ties since that should reduce the explanation size.
Compute the reason. It is just the reason for the energy after time.
Propagate.
Implements operations_research::sat::PropagatorInterface.
Definition at line 259 of file cumulative_energy.cc.
void operations_research::sat::CumulativeIsAfterSubsetConstraint::RegisterWith | ( | GenericLiteralWatcher * | watcher | ) |
Definition at line 376 of file cumulative_energy.cc.