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

Implementation of AddCumulativeOverloadChecker(). More...

#include <cumulative_energy.h>

Inheritance diagram for operations_research::sat::CumulativeEnergyConstraint:
operations_research::sat::PropagatorInterface

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 > &)
 

Detailed Description

Implementation of AddCumulativeOverloadChecker().

Definition at line 60 of file cumulative_energy.h.

Constructor & Destructor Documentation

◆ CumulativeEnergyConstraint()

operations_research::sat::CumulativeEnergyConstraint::CumulativeEnergyConstraint ( AffineExpression capacity,
SchedulingConstraintHelper * helper,
SchedulingDemandHelper * demands,
Model * model )

Definition at line 66 of file cumulative_energy.cc.

Member Function Documentation

◆ Propagate()

bool operations_research::sat::CumulativeEnergyConstraint::Propagate ( )
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.

Todo
(user): just keep the current direction?
Todo
(user): force capacity_max >= 0, fail/remove optionals when 0.

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.

Todo
(user): We do not need the capacity max in the reason, but by using a lower one, we could maybe have propagated more the minimum capacity. investigate.

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.

Todo
(user): This could be done lazily.
Todo
Todo
(user): the same required task can have its energy pruned several times, making this algorithm O(n^2 log n). Is there a way to get the best pruning in one go? This looks like edge-finding not being able to converge in one pass, so it might not be easy.
Todo
(user): Improve window_end using envelope of critical event.

Implements operations_research::sat::PropagatorInterface.

Definition at line 84 of file cumulative_energy.cc.

◆ RegisterWith()

void operations_research::sat::CumulativeEnergyConstraint::RegisterWith ( GenericLiteralWatcher * watcher)

Definition at line 77 of file cumulative_energy.cc.


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