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

Detailed Description

Definition at line 92 of file scheduling_helpers.h.

#include <scheduling_helpers.h>

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

Classes

struct  ProfileEvent
struct  TaskInfo

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 IsEnforced () const
bool Propagate () final
bool IncrementalPropagate (const std::vector< int > &watch_indices) final
void RegisterWith (GenericLiteralWatcher *watcher, absl::Span< const Literal > enforcement_literals)
void SetEnforcementId (EnforcementId id)
ABSL_MUST_USE_RESULT bool ResetFromSubset (const SchedulingConstraintHelper &other, absl::Span< const int > tasks)
int NumTasks () const
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
bool IsPresent (LiteralIndex lit) const
bool IsAbsent (LiteralIndex lit) const
IntegerValue GetCurrentMinDistanceBetweenTasks (int a, int b)
bool NotifyLevelZeroPrecedence (int a, int b)
IntegerValue GetMinOverlap (int t, IntegerValue start, IntegerValue end) const
bool TaskIsBeforeOrIsOverlapping (int before, int after)
std::string TaskDebugString (int t) const
absl::Span< const TaskTimeTaskByIncreasingStartMin ()
absl::Span< const TaskTimeTaskByDecreasingEndMax ()
absl::Span< const TaskTimeTaskByIncreasingNegatedStartMax ()
absl::Span< const TaskTimeTaskByIncreasingEndMin ()
absl::Span< const CachedTaskBoundsTaskByIncreasingShiftedStartMin ()
absl::Span< const CachedTaskBoundsTaskByIncreasingNegatedShiftedEndMax ()
const std::vector< ProfileEvent > & GetEnergyProfile ()
void ResetReason ()
void ImportReasonsFromOther (const SchedulingConstraintHelper &other_helper)
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 AddLiteralReason (Literal l)
void AddIntegerReason (IntegerLiteral l)
void AddReasonForBeingBeforeAssumingNoOverlap (int before, int after)
void AddReasonForUpperBoundLowerThan (LinearExpression2 expr, IntegerValue ub)
void AppendAndResetReason (std::vector< IntegerLiteral > *integer_reason, std::vector< Literal > *literal_reason)
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_MUST_USE_RESULT bool PushTaskOrderWhenPresent (int t_before, int t_after)
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 SetExtraExplanationForItemCallback (std::function< void(absl::Span< const int > items, std::vector< Literal > *reason, std::vector< IntegerLiteral > *integer_reason)> extra_explanation_callback)
bool InPropagationLoop () const
int CurrentDecisionLevel () const
int64_t PropagationTimestamp () const
FixedCapacityVector< TaskTime > & GetScratchTaskTimeVector1 ()
FixedCapacityVector< TaskTime > & GetScratchTaskTimeVector2 ()
FixedCapacityVector< TaskInfo > & GetScratchTaskSet ()
Public Member Functions inherited from operations_research::sat::PropagatorInterface
 PropagatorInterface ()=default
virtual ~PropagatorInterface ()=default

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 )

Definition at line 42 of file scheduling_helpers.cc.

◆ SchedulingConstraintHelper() [2/2]

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

Definition at line 87 of file scheduling_helpers.cc.

Member Function Documentation

◆ AddAbsenceReason()

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

Definition at line 745 of file scheduling_helpers.h.

◆ AddEndMaxReason()

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

Definition at line 822 of file scheduling_helpers.h.

◆ AddEndMinReason()

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

Definition at line 814 of file scheduling_helpers.h.

◆ AddEnergyAfterReason()

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

Definition at line 834 of file scheduling_helpers.h.

◆ AddEnergyMinInIntervalReason()

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

Definition at line 844 of file scheduling_helpers.h.

◆ AddIntegerReason()

void operations_research::sat::SchedulingConstraintHelper::AddIntegerReason ( IntegerLiteral l)
inline

Definition at line 865 of file scheduling_helpers.h.

◆ AddLiteralReason()

void operations_research::sat::SchedulingConstraintHelper::AddLiteralReason ( Literal l)
inline

Definition at line 861 of file scheduling_helpers.h.

◆ AddPresenceReason()

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

Definition at line 737 of file scheduling_helpers.h.

◆ AddReasonForBeingBeforeAssumingNoOverlap()

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

Definition at line 522 of file scheduling_helpers.cc.

◆ AddReasonForUpperBoundLowerThan()

void operations_research::sat::SchedulingConstraintHelper::AddReasonForUpperBoundLowerThan ( LinearExpression2 expr,
IntegerValue ub )

Definition at line 1146 of file scheduling_helpers.cc.

◆ AddShiftedEndMaxReason()

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

Definition at line 829 of file scheduling_helpers.h.

◆ AddSizeMaxReason()

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

Definition at line 793 of file scheduling_helpers.h.

◆ AddSizeMinReason() [1/2]

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

Definition at line 753 of file scheduling_helpers.h.

◆ AddSizeMinReason() [2/2]

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

Definition at line 784 of file scheduling_helpers.h.

◆ AddStartMaxReason()

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

Definition at line 807 of file scheduling_helpers.h.

◆ AddStartMinReason()

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

Definition at line 800 of file scheduling_helpers.h.

◆ AppendAndResetReason()

void operations_research::sat::SchedulingConstraintHelper::AppendAndResetReason ( std::vector< IntegerLiteral > * integer_reason,
std::vector< Literal > * literal_reason )

Definition at line 1152 of file scheduling_helpers.cc.

◆ CurrentDecisionLevel()

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

Definition at line 398 of file scheduling_helpers.h.

◆ CurrentTimeIsForward()

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

Definition at line 140 of file scheduling_helpers.h.

◆ DecreaseEndMax()

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

Definition at line 688 of file scheduling_helpers.cc.

◆ EndIsFixed()

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

Definition at line 686 of file scheduling_helpers.h.

◆ EndMax()

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

Definition at line 164 of file scheduling_helpers.h.

◆ EndMin()

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

Definition at line 162 of file scheduling_helpers.h.

◆ Ends()

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

Definition at line 349 of file scheduling_helpers.h.

◆ GetCurrentMinDistanceBetweenTasks()

IntegerValue operations_research::sat::SchedulingConstraintHelper::GetCurrentMinDistanceBetweenTasks ( int a,
int b )

Definition at line 362 of file scheduling_helpers.cc.

◆ GetEnergyProfile()

const std::vector< SchedulingConstraintHelper::ProfileEvent > & operations_research::sat::SchedulingConstraintHelper::GetEnergyProfile ( )

Definition at line 491 of file scheduling_helpers.cc.

◆ GetIntervalDefinition()

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

Definition at line 352 of file scheduling_helpers.h.

◆ GetMinOverlap()

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

Definition at line 823 of file scheduling_helpers.cc.

◆ GetScratchTaskSet()

FixedCapacityVector< TaskInfo > & operations_research::sat::SchedulingConstraintHelper::GetScratchTaskSet ( )
inline

Definition at line 424 of file scheduling_helpers.h.

◆ GetScratchTaskTimeVector1()

FixedCapacityVector< TaskTime > & operations_research::sat::SchedulingConstraintHelper::GetScratchTaskTimeVector1 ( )
inline

Definition at line 416 of file scheduling_helpers.h.

◆ GetScratchTaskTimeVector2()

FixedCapacityVector< TaskTime > & operations_research::sat::SchedulingConstraintHelper::GetScratchTaskTimeVector2 ( )
inline

Definition at line 420 of file scheduling_helpers.h.

◆ ImportReasonsFromOther()

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

Definition at line 801 of file scheduling_helpers.cc.

◆ IncreaseEndMin()

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

Definition at line 680 of file scheduling_helpers.cc.

◆ IncreaseStartMin()

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

Definition at line 672 of file scheduling_helpers.cc.

◆ IncrementalPropagate()

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

Reimplemented from operations_research::sat::PropagatorInterface.

Definition at line 122 of file scheduling_helpers.cc.

◆ InPropagationLoop()

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

Definition at line 396 of file scheduling_helpers.h.

◆ IsAbsent() [1/2]

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

Definition at line 708 of file scheduling_helpers.h.

◆ IsAbsent() [2/2]

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

Definition at line 725 of file scheduling_helpers.h.

◆ IsEnforced()

bool operations_research::sat::SchedulingConstraintHelper::IsEnforced ( ) const

Definition at line 110 of file scheduling_helpers.cc.

◆ IsOptional() [1/2]

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

Definition at line 694 of file scheduling_helpers.h.

◆ IsOptional() [2/2]

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

Definition at line 716 of file scheduling_helpers.h.

◆ IsPresent() [1/2]

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

Definition at line 700 of file scheduling_helpers.h.

◆ IsPresent() [2/2]

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

Definition at line 720 of file scheduling_helpers.h.

◆ LevelZeroEndMax()

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

Definition at line 178 of file scheduling_helpers.h.

◆ LevelZeroSizeMin()

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

Definition at line 166 of file scheduling_helpers.h.

◆ LevelZeroStartMax()

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

Definition at line 175 of file scheduling_helpers.h.

◆ LevelZeroStartMin()

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

Definition at line 172 of file scheduling_helpers.h.

◆ NotifyLevelZeroPrecedence()

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

Definition at line 379 of file scheduling_helpers.cc.

◆ NumTasks()

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

Definition at line 133 of file scheduling_helpers.h.

◆ PresenceLiteral()

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

Definition at line 362 of file scheduling_helpers.h.

◆ Propagate()

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

◆ PropagationTimestamp()

int64_t operations_research::sat::SchedulingConstraintHelper::PropagationTimestamp ( ) const
inline

Definition at line 403 of file scheduling_helpers.h.

◆ PushIntegerLiteral()

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

Definition at line 645 of file scheduling_helpers.cc.

◆ PushIntegerLiteralIfTaskPresent()

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

Definition at line 650 of file scheduling_helpers.cc.

◆ PushLiteral()

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

Definition at line 696 of file scheduling_helpers.cc.

◆ PushTaskAbsence()

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

Definition at line 700 of file scheduling_helpers.cc.

◆ PushTaskOrderWhenPresent()

bool operations_research::sat::SchedulingConstraintHelper::PushTaskOrderWhenPresent ( int t_before,
int t_after )

Definition at line 731 of file scheduling_helpers.cc.

◆ PushTaskPresence()

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

Definition at line 716 of file scheduling_helpers.cc.

◆ RegisterWith()

void operations_research::sat::SchedulingConstraintHelper::RegisterWith ( GenericLiteralWatcher * watcher,
absl::Span< const Literal > enforcement_literals )

Definition at line 130 of file scheduling_helpers.cc.

◆ ReportConflict()

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

Definition at line 775 of file scheduling_helpers.cc.

◆ ResetFromSubset()

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

Definition at line 235 of file scheduling_helpers.cc.

◆ ResetReason()

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

Definition at line 730 of file scheduling_helpers.h.

◆ SetEnforcementId()

void operations_research::sat::SchedulingConstraintHelper::SetEnforcementId ( EnforcementId id)
inline

Definition at line 125 of file scheduling_helpers.h.

◆ SetExtraExplanationForItemCallback()

void operations_research::sat::SchedulingConstraintHelper::SetExtraExplanationForItemCallback ( std::function< void(absl::Span< const int > items, std::vector< Literal > *reason, std::vector< IntegerLiteral > *integer_reason)> extra_explanation_callback)
inline

Definition at line 383 of file scheduling_helpers.h.

◆ SetTimeDirection()

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

Definition at line 301 of file scheduling_helpers.cc.

◆ ShiftedEndMax()

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

Definition at line 202 of file scheduling_helpers.h.

◆ ShiftedStartMin()

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

Definition at line 196 of file scheduling_helpers.h.

◆ SizeIsFixed()

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

Definition at line 690 of file scheduling_helpers.h.

◆ SizeMax()

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

Definition at line 157 of file scheduling_helpers.h.

◆ SizeMin()

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

Definition at line 156 of file scheduling_helpers.h.

◆ Sizes()

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

Definition at line 350 of file scheduling_helpers.h.

◆ StartIsFixed()

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

Definition at line 682 of file scheduling_helpers.h.

◆ StartMax()

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

Definition at line 163 of file scheduling_helpers.h.

◆ StartMin()

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

Definition at line 161 of file scheduling_helpers.h.

◆ Starts()

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

Definition at line 348 of file scheduling_helpers.h.

◆ SynchronizeAndSetTimeDirection()

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

Definition at line 323 of file scheduling_helpers.cc.

◆ TaskByDecreasingEndMax()

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

Definition at line 444 of file scheduling_helpers.cc.

◆ TaskByIncreasingEndMin()

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

Definition at line 420 of file scheduling_helpers.cc.

◆ TaskByIncreasingNegatedShiftedEndMax()

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

Definition at line 472 of file scheduling_helpers.cc.

◆ TaskByIncreasingNegatedStartMax()

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

Definition at line 432 of file scheduling_helpers.cc.

◆ TaskByIncreasingShiftedStartMin()

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

Definition at line 454 of file scheduling_helpers.cc.

◆ TaskByIncreasingStartMin()

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

Definition at line 410 of file scheduling_helpers.cc.

◆ TaskDebugString()

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

Definition at line 812 of file scheduling_helpers.cc.

◆ TaskIsBeforeOrIsOverlapping()

bool operations_research::sat::SchedulingConstraintHelper::TaskIsBeforeOrIsOverlapping ( int before,
int after )

Definition at line 515 of file scheduling_helpers.cc.

◆ WatchAllTasks()

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

Definition at line 781 of file scheduling_helpers.cc.


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