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

#include <cumulative_energy.h>

Inheritance diagram for operations_research::sat::CumulativeIsAfterSubsetConstraint:
operations_research::sat::PropagatorInterface

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

Detailed Description

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.

Todo
(user): I am not sure this is the best way, but it does at least push the level zero bound on the large cumulative instances.

Definition at line 91 of file cumulative_energy.h.

Constructor & Destructor Documentation

◆ CumulativeIsAfterSubsetConstraint()

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.

Member Function Documentation

◆ Propagate()

bool operations_research::sat::CumulativeIsAfterSubsetConstraint::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.

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.

Note
if the energy is zero, we don't push anything. Other propagator will make sure that the end_min is greater than the end_min of any of the task considered here.
Todo
(user): actually, we will push using the last task, and the reason will be non-optimal, fix.

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.

◆ RegisterWith()

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

Definition at line 376 of file cumulative_energy.cc.


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