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

#include <intervals.h>

Inheritance diagram for operations_research::sat::SchedulingConstraintHelper:
operations_research::sat::PropagatorInterface operations_research::sat::AllIntervalsHelper

Classes

struct  ProfileEvent
 

Public Member Functions

 SchedulingConstraintHelper (const std::vector< IntervalVariable > &tasks, Model *model)
 
 SchedulingConstraintHelper (int num_tasks, Model *model)
 
bool Propagate () final
 
bool IncrementalPropagate (const std::vector< int > &watch_indices) final
 
void RegisterWith (GenericLiteralWatcher *watcher)
 
ABSL_MUST_USE_RESULT bool ResetFromSubset (const SchedulingConstraintHelper &other, absl::Span< const int > tasks)
 
int NumTasks () const
 Returns the number of task.
 
void SetTimeDirection (bool is_forward)
 
bool CurrentTimeIsForward () const
 
ABSL_MUST_USE_RESULT bool SynchronizeAndSetTimeDirection (bool is_forward)
 
IntegerValue SizeMin (int t) const
 
IntegerValue SizeMax (int t) const
 
IntegerValue StartMin (int t) const
 
IntegerValue EndMin (int t) const
 
IntegerValue StartMax (int t) const
 
IntegerValue EndMax (int t) const
 
IntegerValue LevelZeroStartMin (int t) const
 
IntegerValue LevelZeroStartMax (int t) const
 
IntegerValue LevelZeroEndMax (int t) const
 
IntegerValue ShiftedStartMin (int t) const
 
IntegerValue ShiftedEndMax (int t) const
 
bool StartIsFixed (int t) const
 
bool EndIsFixed (int t) const
 
bool SizeIsFixed (int t) const
 
bool IsOptional (int t) const
 
bool IsPresent (int t) const
 
bool IsAbsent (int t) const
 
bool IsOptional (LiteralIndex lit) const
 Same if one already have the presence LiteralIndex of a task.
 
bool IsPresent (LiteralIndex lit) const
 
bool IsAbsent (LiteralIndex lit) const
 
IntegerValue GetCurrentMinDistanceBetweenTasks (int a, int b, bool add_reason_if_after=false)
 
bool PropagatePrecedence (int a, int b)
 
IntegerValue GetMinOverlap (int t, IntegerValue start, IntegerValue end) const
 
std::string TaskDebugString (int t) const
 Returns a string with the current task bounds.
 
absl::Span< const TaskTimeTaskByIncreasingStartMin ()
 
absl::Span< const TaskTimeTaskByDecreasingEndMax ()
 
absl::Span< const TaskTimeTaskByIncreasingNegatedStartMax ()
 
absl::Span< const TaskTimeTaskByIncreasingEndMin ()
 
absl::Span< const CachedTaskBoundsTaskByIncreasingShiftedStartMin ()
 
const std::vector< ProfileEvent > & GetEnergyProfile ()
 
void ClearReason ()
 Functions to clear and then set the current reason.
 
void AddPresenceReason (int t)
 
void AddAbsenceReason (int t)
 
void AddSizeMinReason (int t)
 
void AddSizeMinReason (int t, IntegerValue lower_bound)
 
void AddSizeMaxReason (int t, IntegerValue upper_bound)
 
void AddStartMinReason (int t, IntegerValue lower_bound)
 
void AddStartMaxReason (int t, IntegerValue upper_bound)
 
void AddEndMinReason (int t, IntegerValue lower_bound)
 
void AddEndMaxReason (int t, IntegerValue upper_bound)
 
void AddShiftedEndMaxReason (int t, IntegerValue upper_bound)
 
void AddEnergyAfterReason (int t, IntegerValue energy_min, IntegerValue time)
 
void AddEnergyMinInIntervalReason (int t, IntegerValue min, IntegerValue max)
 
void AddReasonForBeingBefore (int before, int after)
 Produces a relaxed reason for StartMax(before) < EndMin(after).
 
std::vector< Literal > * MutableLiteralReason ()
 
std::vector< IntegerLiteral > * MutableIntegerReason ()
 
ABSL_MUST_USE_RESULT bool IncreaseStartMin (int t, IntegerValue value)
 
ABSL_MUST_USE_RESULT bool IncreaseEndMin (int t, IntegerValue value)
 
ABSL_MUST_USE_RESULT bool DecreaseEndMax (int t, IntegerValue value)
 
ABSL_MUST_USE_RESULT bool PushLiteral (Literal l)
 
ABSL_MUST_USE_RESULT bool PushTaskAbsence (int t)
 
ABSL_MUST_USE_RESULT bool PushTaskPresence (int t)
 
ABSL_MUST_USE_RESULT bool PushIntegerLiteral (IntegerLiteral lit)
 
ABSL_MUST_USE_RESULT bool ReportConflict ()
 
ABSL_MUST_USE_RESULT bool PushIntegerLiteralIfTaskPresent (int t, IntegerLiteral lit)
 
absl::Span< const IntervalVariable > IntervalVariables () const
 Returns the underlying affine expressions.
 
absl::Span< const AffineExpressionStarts () const
 
absl::Span< const AffineExpressionEnds () const
 
absl::Span< const AffineExpressionSizes () const
 
Literal PresenceLiteral (int index) const
 
void WatchAllTasks (int id, bool watch_max_side=true)
 
void SetOtherHelper (SchedulingConstraintHelper *other_helper, absl::Span< const int > map_to_other_helper, IntegerValue event)
 
bool HasOtherHelper () const
 
void ClearOtherHelper ()
 
void ImportOtherReasons (const SchedulingConstraintHelper &other_helper)
 
bool InPropagationLoop () const
 
int CurrentDecisionLevel () const
 
- Public Member Functions inherited from operations_research::sat::PropagatorInterface
 PropagatorInterface ()=default
 
virtual ~PropagatorInterface ()=default
 

Detailed Description

Helper class shared by the propagators that manage a given list of tasks.

One of the main advantage of this class is that it allows to share the vectors of tasks sorted by various criteria between propagator for a faster code.

Definition at line 264 of file intervals.h.

Constructor & Destructor Documentation

◆ SchedulingConstraintHelper() [1/2]

operations_research::sat::SchedulingConstraintHelper::SchedulingConstraintHelper ( const std::vector< IntervalVariable > & tasks,
Model * model )

All the functions below refer to a task by its index t in the tasks vector given at construction.

Definition at line 228 of file intervals.cc.

◆ SchedulingConstraintHelper() [2/2]

operations_research::sat::SchedulingConstraintHelper::SchedulingConstraintHelper ( int num_tasks,
Model * model )

Temporary constructor. The class will not be usable until ResetFromSubset() is called.

Todo
(user): Remove this. It is a hack because the disjunctive class needs to fetch the maximum possible number of task at construction.

Definition at line 273 of file intervals.cc.

Member Function Documentation

◆ AddAbsenceReason()

void operations_research::sat::SchedulingConstraintHelper::AddAbsenceReason ( int t)
inline

Definition at line 818 of file intervals.h.

◆ AddEndMaxReason()

void operations_research::sat::SchedulingConstraintHelper::AddEndMaxReason ( int t,
IntegerValue upper_bound )
inline

Definition at line 895 of file intervals.h.

◆ AddEndMinReason()

void operations_research::sat::SchedulingConstraintHelper::AddEndMinReason ( int t,
IntegerValue lower_bound )
inline

Definition at line 887 of file intervals.h.

◆ AddEnergyAfterReason()

void operations_research::sat::SchedulingConstraintHelper::AddEnergyAfterReason ( int t,
IntegerValue energy_min,
IntegerValue time )
inline

Definition at line 907 of file intervals.h.

◆ AddEnergyMinInIntervalReason()

void operations_research::sat::SchedulingConstraintHelper::AddEnergyMinInIntervalReason ( int t,
IntegerValue min,
IntegerValue max )
inline

Definition at line 917 of file intervals.h.

◆ AddPresenceReason()

void operations_research::sat::SchedulingConstraintHelper::AddPresenceReason ( int t)
inline

Definition at line 810 of file intervals.h.

◆ AddReasonForBeingBefore()

void operations_research::sat::SchedulingConstraintHelper::AddReasonForBeingBefore ( int before,
int after )

Produces a relaxed reason for StartMax(before) < EndMin(after).

Adds the reason why task "before" must be before task "after". That is StartMax(before) < EndMin(after).

The reason will be a linear expression greater than a value. Note that all coeff must be positive, and we will use the variable lower bound.

Reason for StartMax(before).

Reason for EndMin(after);

Definition at line 657 of file intervals.cc.

◆ AddShiftedEndMaxReason()

void operations_research::sat::SchedulingConstraintHelper::AddShiftedEndMaxReason ( int t,
IntegerValue upper_bound )
inline

Definition at line 902 of file intervals.h.

◆ AddSizeMaxReason()

void operations_research::sat::SchedulingConstraintHelper::AddSizeMaxReason ( int t,
IntegerValue upper_bound )
inline

Definition at line 866 of file intervals.h.

◆ AddSizeMinReason() [1/2]

void operations_research::sat::SchedulingConstraintHelper::AddSizeMinReason ( int t)
inline

Definition at line 826 of file intervals.h.

◆ AddSizeMinReason() [2/2]

void operations_research::sat::SchedulingConstraintHelper::AddSizeMinReason ( int t,
IntegerValue lower_bound )
inline

Definition at line 857 of file intervals.h.

◆ AddStartMaxReason()

void operations_research::sat::SchedulingConstraintHelper::AddStartMaxReason ( int t,
IntegerValue upper_bound )
inline

Definition at line 880 of file intervals.h.

◆ AddStartMinReason()

void operations_research::sat::SchedulingConstraintHelper::AddStartMinReason ( int t,
IntegerValue lower_bound )
inline

Definition at line 873 of file intervals.h.

◆ ClearOtherHelper()

void operations_research::sat::SchedulingConstraintHelper::ClearOtherHelper ( )
inline

Definition at line 508 of file intervals.h.

◆ ClearReason()

void operations_research::sat::SchedulingConstraintHelper::ClearReason ( )
inline

Functions to clear and then set the current reason.

Definition at line 801 of file intervals.h.

◆ CurrentDecisionLevel()

int operations_research::sat::SchedulingConstraintHelper::CurrentDecisionLevel ( ) const
inline

Definition at line 521 of file intervals.h.

◆ CurrentTimeIsForward()

bool operations_research::sat::SchedulingConstraintHelper::CurrentTimeIsForward ( ) const
inline

Definition at line 300 of file intervals.h.

◆ DecreaseEndMax()

bool operations_research::sat::SchedulingConstraintHelper::DecreaseEndMax ( int t,
IntegerValue value )

Definition at line 752 of file intervals.cc.

◆ EndIsFixed()

bool operations_research::sat::SchedulingConstraintHelper::EndIsFixed ( int t) const
inline

Definition at line 765 of file intervals.h.

◆ EndMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::EndMax ( int t) const
inline

Definition at line 324 of file intervals.h.

◆ EndMin()

IntegerValue operations_research::sat::SchedulingConstraintHelper::EndMin ( int t) const
inline

Definition at line 322 of file intervals.h.

◆ Ends()

absl::Span< const AffineExpression > operations_research::sat::SchedulingConstraintHelper::Ends ( ) const
inline

Definition at line 480 of file intervals.h.

◆ GetCurrentMinDistanceBetweenTasks()

IntegerValue operations_research::sat::SchedulingConstraintHelper::GetCurrentMinDistanceBetweenTasks ( int a,
int b,
bool add_reason_if_after = false )

Return a value so that End(a) + dist <= Start(b). Returns kMinInterValue if we don't have any such relation.

Todo
(user): be more precise when we know a and b are in disjunction. we really just need start_b > start_a, or even >= if duration is non-zero.

We take the max of the level zero offset and the one coming from a conditional precedence at true.

Definition at line 510 of file intervals.cc.

◆ GetEnergyProfile()

const std::vector< SchedulingConstraintHelper::ProfileEvent > & operations_research::sat::SchedulingConstraintHelper::GetEnergyProfile ( )
Todo
(user): Avoid recomputing it if nothing changed.

Definition at line 632 of file intervals.cc.

◆ GetMinOverlap()

IntegerValue operations_research::sat::SchedulingConstraintHelper::GetMinOverlap ( int t,
IntegerValue start,
IntegerValue end ) const

Return the minimum overlap of interval i with the time window [start..end].

Note
this is different from the mandatory part of an interval.

Definition at line 858 of file intervals.cc.

◆ HasOtherHelper()

bool operations_research::sat::SchedulingConstraintHelper::HasOtherHelper ( ) const
inline

Definition at line 506 of file intervals.h.

◆ ImportOtherReasons()

void operations_research::sat::SchedulingConstraintHelper::ImportOtherReasons ( const SchedulingConstraintHelper & other_helper)

Adds to this helper reason all the explanation of the other helper. This checks that other_helper_ is null.

This is used in the 2D energetic reasoning in the diffn constraint.

Definition at line 840 of file intervals.cc.

◆ IncreaseEndMin()

bool operations_research::sat::SchedulingConstraintHelper::IncreaseEndMin ( int t,
IntegerValue value )

Definition at line 744 of file intervals.cc.

◆ IncreaseStartMin()

bool operations_research::sat::SchedulingConstraintHelper::IncreaseStartMin ( int t,
IntegerValue value )

Push something using the current reason. Note that IncreaseStartMin() will also increase the end-min, and DecreaseEndMax() will also decrease the start-max.

Important: IncreaseStartMin() and DecreaseEndMax() can be called on an optional interval whose presence is still unknown and push a bound conditioned on its presence. The functions will do the correct thing depending on whether or not the start_min/end_max are optional variables whose presence implies the interval presence.

Definition at line 736 of file intervals.cc.

◆ IncrementalPropagate()

bool operations_research::sat::SchedulingConstraintHelper::IncrementalPropagate ( const std::vector< int > & )
finalvirtual

This will only be called on a non-empty vector, otherwise Propagate() will be called. The passed vector will contain the "watch index" of all the literals that were given one at registration and that changed since the last call to Propagate(). This is only true when going down in the search tree, on backjump this list will be cleared.

Notes:

  • The indices may contain duplicates if the same integer variable as been updated many times or if different watched literals have the same watch_index.
  • At level zero, it will not contain any indices associated with literals that were already fixed when the propagator was registered. Only the indices of the literals modified after the registration will be present.

Reimplemented from operations_research::sat::PropagatorInterface.

Definition at line 298 of file intervals.cc.

◆ InPropagationLoop()

bool operations_research::sat::SchedulingConstraintHelper::InPropagationLoop ( ) const
inline
Todo
(user): Change the propagation loop code so that we don't stop pushing in the middle of the propagation as more advanced propagator do not handle this correctly.

Definition at line 519 of file intervals.h.

◆ IntervalVariables()

absl::Span< const IntervalVariable > operations_research::sat::SchedulingConstraintHelper::IntervalVariables ( ) const
inline

Returns the underlying affine expressions.

Definition at line 476 of file intervals.h.

◆ IsAbsent() [1/2]

bool operations_research::sat::SchedulingConstraintHelper::IsAbsent ( int t) const
inline

Definition at line 782 of file intervals.h.

◆ IsAbsent() [2/2]

bool operations_research::sat::SchedulingConstraintHelper::IsAbsent ( LiteralIndex lit) const
inline

Definition at line 796 of file intervals.h.

◆ IsOptional() [1/2]

bool operations_research::sat::SchedulingConstraintHelper::IsOptional ( int t) const
inline

Returns true if the corresponding fact is known for sure. A normal task is always present. For optional task for which the presence is still unknown, both of these function will return false.

Definition at line 773 of file intervals.h.

◆ IsOptional() [2/2]

bool operations_research::sat::SchedulingConstraintHelper::IsOptional ( LiteralIndex lit) const
inline

Same if one already have the presence LiteralIndex of a task.

Definition at line 787 of file intervals.h.

◆ IsPresent() [1/2]

bool operations_research::sat::SchedulingConstraintHelper::IsPresent ( int t) const
inline

Definition at line 777 of file intervals.h.

◆ IsPresent() [2/2]

bool operations_research::sat::SchedulingConstraintHelper::IsPresent ( LiteralIndex lit) const
inline

Definition at line 791 of file intervals.h.

◆ LevelZeroEndMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::LevelZeroEndMax ( int t) const
inline

Definition at line 332 of file intervals.h.

◆ LevelZeroStartMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::LevelZeroStartMax ( int t) const
inline

Definition at line 329 of file intervals.h.

◆ LevelZeroStartMin()

IntegerValue operations_research::sat::SchedulingConstraintHelper::LevelZeroStartMin ( int t) const
inline

Definition at line 326 of file intervals.h.

◆ MutableIntegerReason()

std::vector< IntegerLiteral > * operations_research::sat::SchedulingConstraintHelper::MutableIntegerReason ( )
inline

Definition at line 451 of file intervals.h.

◆ MutableLiteralReason()

std::vector< Literal > * operations_research::sat::SchedulingConstraintHelper::MutableLiteralReason ( )
inline

It is also possible to directly manipulates the underlying reason vectors that will be used when pushing something.

Definition at line 450 of file intervals.h.

◆ NumTasks()

int operations_research::sat::SchedulingConstraintHelper::NumTasks ( ) const
inline

Returns the number of task.

Definition at line 293 of file intervals.h.

◆ PresenceLiteral()

Literal operations_research::sat::SchedulingConstraintHelper::PresenceLiteral ( int index) const
inline

Definition at line 483 of file intervals.h.

◆ Propagate()

bool operations_research::sat::SchedulingConstraintHelper::Propagate ( )
finalvirtual

This is a propagator so we can "cache" all the intervals relevant information. This gives good speedup. Note however that the info is stale except if a bound was pushed by this helper or if this was called. We run it at the highest priority, so that will mostly be the case at the beginning of each Propagate() call of the classes using this.

Implements operations_research::sat::PropagatorInterface.

Definition at line 292 of file intervals.cc.

◆ PropagatePrecedence()

bool operations_research::sat::SchedulingConstraintHelper::PropagatePrecedence ( int a,
int b )

We detected a precedence between two tasks. If we are at level zero, we might want to add the constraint. If we are at positive level, we might want to propagate the associated precedence literal if it exists.

Note
we could call this at a positive level to propagate any literal associated to task a before task b. However we only call this for task that are in detectable precedence, which means the normal precedence or linear propagator should have already propagated that Boolean too.
Todo
(user): Adding new constraint during propagation might not be the best idea as it can create some complication.

Definition at line 542 of file intervals.cc.

◆ PushIntegerLiteral()

bool operations_research::sat::SchedulingConstraintHelper::PushIntegerLiteral ( IntegerLiteral lit)

Definition at line 709 of file intervals.cc.

◆ PushIntegerLiteralIfTaskPresent()

bool operations_research::sat::SchedulingConstraintHelper::PushIntegerLiteralIfTaskPresent ( int t,
IntegerLiteral lit )

Definition at line 714 of file intervals.cc.

◆ PushLiteral()

bool operations_research::sat::SchedulingConstraintHelper::PushLiteral ( Literal l)

Definition at line 760 of file intervals.cc.

◆ PushTaskAbsence()

bool operations_research::sat::SchedulingConstraintHelper::PushTaskAbsence ( int t)

Definition at line 765 of file intervals.cc.

◆ PushTaskPresence()

bool operations_research::sat::SchedulingConstraintHelper::PushTaskPresence ( int t)

Definition at line 781 of file intervals.cc.

◆ RegisterWith()

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

Definition at line 305 of file intervals.cc.

◆ ReportConflict()

bool operations_research::sat::SchedulingConstraintHelper::ReportConflict ( )

Definition at line 797 of file intervals.cc.

◆ ResetFromSubset()

bool operations_research::sat::SchedulingConstraintHelper::ResetFromSubset ( const SchedulingConstraintHelper & other,
absl::Span< const int > tasks )

Resets the class to the same state as if it was constructed with the given subset of tasks from other.

Definition at line 396 of file intervals.cc.

◆ SetOtherHelper()

void operations_research::sat::SchedulingConstraintHelper::SetOtherHelper ( SchedulingConstraintHelper * other_helper,
absl::Span< const int > map_to_other_helper,
IntegerValue event )
inline

Manages the other helper (used by the diffn constraint).

For each interval appearing in a reason on this helper, another reason will be added. This other reason specifies that on the other helper, the corresponding interval overlaps 'event'.

Definition at line 497 of file intervals.h.

◆ SetTimeDirection()

void operations_research::sat::SchedulingConstraintHelper::SetTimeDirection ( bool is_forward)

Make sure the cached values are up to date. Also sets the time direction to either forward/backward. This will impact all the functions below. This MUST be called at the beginning of all Propagate() call that uses this helper.

Definition at line 461 of file intervals.cc.

◆ ShiftedEndMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::ShiftedEndMax ( int t) const
inline

As with ShiftedStartMin(), we can compute the shifted end max (that is start_max + size_min.

Definition at line 356 of file intervals.h.

◆ ShiftedStartMin()

IntegerValue operations_research::sat::SchedulingConstraintHelper::ShiftedStartMin ( int t) const
inline

In the presence of tasks with a variable size, we do not necessarily have start_min + size_min = end_min, we can instead have a situation like: | |<— size-min --->| ^ ^ ^ start-min | end-min | We define the "shifted start min" to be the right most time such that we known that we must have min-size "energy" to the right of it if the task is present. Using it in our scheduling propagators allows to propagate more in the presence of tasks with variable size (or optional task where we also do not necessarily have start_min + size_min = end_min.

To explain this shifted start min, one must use the AddEnergyAfterReason().

Definition at line 350 of file intervals.h.

◆ SizeIsFixed()

bool operations_research::sat::SchedulingConstraintHelper::SizeIsFixed ( int t) const
inline

Definition at line 769 of file intervals.h.

◆ SizeMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::SizeMax ( int t) const
inline

This one is "rare" so we don't cache it.

Definition at line 317 of file intervals.h.

◆ SizeMin()

IntegerValue operations_research::sat::SchedulingConstraintHelper::SizeMin ( int t) const
inline

Helpers for the current bounds on the current task time window. [ (size-min) ... (size-min) ] ^ ^ ^ ^ start-min end-min start-max end-max

Note
for tasks with variable durations, we don't necessarily have duration-min between the XXX-min and XXX-max value.

Remark: We use cached values for most of these function as this is faster. In practice, the cache will almost always be up to date, but not in corner cases where pushing the start of one task will change values for many others. This is fine as the new values will be picked up as we reach the propagation fixed point.

Definition at line 316 of file intervals.h.

◆ Sizes()

absl::Span< const AffineExpression > operations_research::sat::SchedulingConstraintHelper::Sizes ( ) const
inline

Definition at line 481 of file intervals.h.

◆ StartIsFixed()

bool operations_research::sat::SchedulingConstraintHelper::StartIsFixed ( int t) const
inline

SchedulingConstraintHelper inlined functions.

Definition at line 761 of file intervals.h.

◆ StartMax()

IntegerValue operations_research::sat::SchedulingConstraintHelper::StartMax ( int t) const
inline

Definition at line 323 of file intervals.h.

◆ StartMin()

IntegerValue operations_research::sat::SchedulingConstraintHelper::StartMin ( int t) const
inline

Definition at line 321 of file intervals.h.

◆ Starts()

absl::Span< const AffineExpression > operations_research::sat::SchedulingConstraintHelper::Starts ( ) const
inline

Definition at line 479 of file intervals.h.

◆ SynchronizeAndSetTimeDirection()

bool operations_research::sat::SchedulingConstraintHelper::SynchronizeAndSetTimeDirection ( bool is_forward)

If there was any backtracks since the last time this was called, we recompute our cache.

Definition at line 483 of file intervals.cc.

◆ TaskByDecreasingEndMax()

absl::Span< const TaskTime > operations_research::sat::SchedulingConstraintHelper::TaskByDecreasingEndMax ( )

Definition at line 603 of file intervals.cc.

◆ TaskByIncreasingEndMin()

absl::Span< const TaskTime > operations_research::sat::SchedulingConstraintHelper::TaskByIncreasingEndMin ( )

Definition at line 579 of file intervals.cc.

◆ TaskByIncreasingNegatedStartMax()

absl::Span< const TaskTime > operations_research::sat::SchedulingConstraintHelper::TaskByIncreasingNegatedStartMax ( )

Definition at line 591 of file intervals.cc.

◆ TaskByIncreasingShiftedStartMin()

absl::Span< const CachedTaskBounds > operations_research::sat::SchedulingConstraintHelper::TaskByIncreasingShiftedStartMin ( )

Definition at line 613 of file intervals.cc.

◆ TaskByIncreasingStartMin()

absl::Span< const TaskTime > operations_research::sat::SchedulingConstraintHelper::TaskByIncreasingStartMin ( )

Sorts and returns the tasks in corresponding order at the time of the call.

Note
we do not mean strictly-increasing/strictly-decreasing, there will be duplicate time values in these vectors.
Todo
(user): we could merge the first loop of IncrementalSort() with the loop that fill TaskTime.time at each call.

Definition at line 569 of file intervals.cc.

◆ TaskDebugString()

std::string operations_research::sat::SchedulingConstraintHelper::TaskDebugString ( int t) const

Returns a string with the current task bounds.

Definition at line 850 of file intervals.cc.

◆ WatchAllTasks()

void operations_research::sat::SchedulingConstraintHelper::WatchAllTasks ( int id,
bool watch_max_side = true )

Registers the given propagator id to be called if any of the tasks in this class change. Note that we do not watch size max though.

In all cases, we watch presence literals since this class is not waked up when those changes.

If everything is watched, it is slighlty more efficient to enqueue the propagator when the helper Propagate() is called. This result in less entries in our watched lists.

We only watch "min" side.

Definition at line 802 of file intervals.cc.


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