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

#include <scheduling_helpers.h>

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

Classes

struct  ProfileEvent
 

Public Member Functions

 SchedulingConstraintHelper (std::vector< AffineExpression > starts, std::vector< AffineExpression > ends, std::vector< AffineExpression > sizes, std::vector< LiteralIndex > reason_for_presence, 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 LevelZeroSizeMin (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 AffineExpressionStarts () const
 
absl::Span< const AffineExpressionEnds () const
 
absl::Span< const AffineExpressionSizes () const
 
IntervalDefinition GetIntervalDefinition (int index) const
 
Literal PresenceLiteral (int index) const
 
void WatchAllTasks (int id)
 
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. It is also helpful to allow in-processing: the intervals that are handled by this class are not necessarily the same as the ones in the model.

Definition at line 87 of file scheduling_helpers.h.

Constructor & Destructor Documentation

◆ SchedulingConstraintHelper() [1/2]

operations_research::sat::SchedulingConstraintHelper::SchedulingConstraintHelper ( std::vector< AffineExpression > starts,
std::vector< AffineExpression > ends,
std::vector< AffineExpression > sizes,
std::vector< LiteralIndex > reason_for_presence,
Model * model )

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

Definition at line 44 of file scheduling_helpers.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 85 of file scheduling_helpers.cc.

Member Function Documentation

◆ AddAbsenceReason()

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

Definition at line 671 of file scheduling_helpers.h.

◆ AddEndMaxReason()

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

Definition at line 748 of file scheduling_helpers.h.

◆ AddEndMinReason()

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

Definition at line 740 of file scheduling_helpers.h.

◆ AddEnergyAfterReason()

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

Definition at line 760 of file scheduling_helpers.h.

◆ AddEnergyMinInIntervalReason()

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

Definition at line 770 of file scheduling_helpers.h.

◆ AddPresenceReason()

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

Definition at line 663 of file scheduling_helpers.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 490 of file scheduling_helpers.cc.

◆ AddShiftedEndMaxReason()

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

Definition at line 755 of file scheduling_helpers.h.

◆ AddSizeMaxReason()

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

Definition at line 719 of file scheduling_helpers.h.

◆ AddSizeMinReason() [1/2]

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

Definition at line 679 of file scheduling_helpers.h.

◆ AddSizeMinReason() [2/2]

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

Definition at line 710 of file scheduling_helpers.h.

◆ AddStartMaxReason()

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

Definition at line 733 of file scheduling_helpers.h.

◆ AddStartMinReason()

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

Definition at line 726 of file scheduling_helpers.h.

◆ ClearOtherHelper()

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

Definition at line 346 of file scheduling_helpers.h.

◆ ClearReason()

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

Functions to clear and then set the current reason.

Definition at line 654 of file scheduling_helpers.h.

◆ CurrentDecisionLevel()

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

Definition at line 359 of file scheduling_helpers.h.

◆ CurrentTimeIsForward()

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

Definition at line 126 of file scheduling_helpers.h.

◆ DecreaseEndMax()

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

Definition at line 585 of file scheduling_helpers.cc.

◆ EndIsFixed()

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

Definition at line 610 of file scheduling_helpers.h.

◆ EndMax()

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

Definition at line 150 of file scheduling_helpers.h.

◆ EndMin()

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

Definition at line 148 of file scheduling_helpers.h.

◆ Ends()

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

Definition at line 308 of file scheduling_helpers.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 331 of file scheduling_helpers.cc.

◆ GetEnergyProfile()

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

Definition at line 465 of file scheduling_helpers.cc.

◆ GetIntervalDefinition()

IntervalDefinition operations_research::sat::SchedulingConstraintHelper::GetIntervalDefinition ( int index) const
inline

Definition at line 311 of file scheduling_helpers.h.

◆ 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 675 of file scheduling_helpers.cc.

◆ HasOtherHelper()

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

Definition at line 344 of file scheduling_helpers.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 654 of file scheduling_helpers.cc.

◆ IncreaseEndMin()

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

Definition at line 577 of file scheduling_helpers.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 569 of file scheduling_helpers.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 110 of file scheduling_helpers.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 357 of file scheduling_helpers.h.

◆ IsAbsent() [1/2]

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

Definition at line 632 of file scheduling_helpers.h.

◆ IsAbsent() [2/2]

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

Definition at line 649 of file scheduling_helpers.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 618 of file scheduling_helpers.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 640 of file scheduling_helpers.h.

◆ IsPresent() [1/2]

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

Definition at line 624 of file scheduling_helpers.h.

◆ IsPresent() [2/2]

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

Definition at line 644 of file scheduling_helpers.h.

◆ LevelZeroEndMax()

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

Definition at line 164 of file scheduling_helpers.h.

◆ LevelZeroSizeMin()

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

Note the variable that encodes the size of an absent task can be negative.

Definition at line 152 of file scheduling_helpers.h.

◆ LevelZeroStartMax()

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

Definition at line 161 of file scheduling_helpers.h.

◆ LevelZeroStartMin()

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

Definition at line 158 of file scheduling_helpers.h.

◆ MutableIntegerReason()

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

Definition at line 283 of file scheduling_helpers.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 282 of file scheduling_helpers.h.

◆ NumTasks()

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

Returns the number of task.

Definition at line 119 of file scheduling_helpers.h.

◆ PresenceLiteral()

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

Definition at line 321 of file scheduling_helpers.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 104 of file scheduling_helpers.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 363 of file scheduling_helpers.cc.

◆ PushIntegerLiteral()

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

Definition at line 542 of file scheduling_helpers.cc.

◆ PushIntegerLiteralIfTaskPresent()

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

Definition at line 547 of file scheduling_helpers.cc.

◆ PushLiteral()

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

Definition at line 593 of file scheduling_helpers.cc.

◆ PushTaskAbsence()

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

Definition at line 598 of file scheduling_helpers.cc.

◆ PushTaskPresence()

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

Definition at line 614 of file scheduling_helpers.cc.

◆ RegisterWith()

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

This class do not need to be waked up on presence change, since this is not cached. However given that we can have many propagators that use the same helper, it is nicer to only register this one, and wake up all propagator through it rather than registering all of them individually.

Note
IncrementalPropagate() will do nothing if this is the only change except waking up registered propagators.

Definition at line 117 of file scheduling_helpers.cc.

◆ ReportConflict()

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

Definition at line 630 of file scheduling_helpers.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 218 of file scheduling_helpers.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 335 of file scheduling_helpers.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 282 of file scheduling_helpers.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 188 of file scheduling_helpers.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 182 of file scheduling_helpers.h.

◆ SizeIsFixed()

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

Definition at line 614 of file scheduling_helpers.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 143 of file scheduling_helpers.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 142 of file scheduling_helpers.h.

◆ Sizes()

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

Definition at line 309 of file scheduling_helpers.h.

◆ StartIsFixed()

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

SchedulingConstraintHelper inlined functions.

Definition at line 606 of file scheduling_helpers.h.

◆ StartMax()

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

Definition at line 149 of file scheduling_helpers.h.

◆ StartMin()

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

Definition at line 147 of file scheduling_helpers.h.

◆ Starts()

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

Definition at line 307 of file scheduling_helpers.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 304 of file scheduling_helpers.cc.

◆ TaskByDecreasingEndMax()

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

Definition at line 436 of file scheduling_helpers.cc.

◆ TaskByIncreasingEndMin()

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

Definition at line 412 of file scheduling_helpers.cc.

◆ TaskByIncreasingNegatedStartMax()

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

Definition at line 424 of file scheduling_helpers.cc.

◆ TaskByIncreasingShiftedStartMin()

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

Definition at line 446 of file scheduling_helpers.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 402 of file scheduling_helpers.cc.

◆ TaskDebugString()

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

Returns a string with the current task bounds.

Definition at line 664 of file scheduling_helpers.cc.

◆ WatchAllTasks()

void operations_research::sat::SchedulingConstraintHelper::WatchAllTasks ( int id)

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.

It is more efficient to enqueue the propagator when the helper Propagate() is called. This result in less entries in our watched lists.

Definition at line 635 of file scheduling_helpers.cc.


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