Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Implementation of AddCumulativeOverloadChecker(). More...
#include <cumulative_energy.h>
Public Member Functions | |
CumulativeEnergyConstraint (AffineExpression capacity, 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 > &) |
Implementation of AddCumulativeOverloadChecker().
Definition at line 60 of file cumulative_energy.h.
operations_research::sat::CumulativeEnergyConstraint::CumulativeEnergyConstraint | ( | AffineExpression | capacity, |
SchedulingConstraintHelper * | helper, | ||
SchedulingDemandHelper * | demands, | ||
Model * | model ) |
Definition at line 66 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.
This only uses one time direction, but the helper might be used elsewhere.
Set up theta tree.
Main loop: insert tasks by increasing end_max, check for overloads.
Add the current task to the tree.
Find the critical interval.
Push the new capacity min, note that this can fail if it go above the maximum capacity.
Reduce energy of all tasks whose max energy would exceed an interval ending at current_end.
Some task's max energy is too high, reduce its maximal energy. Explain with tasks present in the critical interval. If it is optional, it might get excluded, in that case, remove it from the tree.
Implements operations_research::sat::PropagatorInterface.
Definition at line 84 of file cumulative_energy.cc.
void operations_research::sat::CumulativeEnergyConstraint::RegisterWith | ( | GenericLiteralWatcher * | watcher | ) |
Definition at line 77 of file cumulative_energy.cc.