14 #ifndef OR_TOOLS_SAT_DISJUNCTIVE_H_
15 #define OR_TOOLS_SAT_DISJUNCTIVE_H_
40 const std::vector<IntervalVariable>& intervals);
46 const std::vector<IntervalVariable>& intervals, Model*
model);
50 const std::vector<IntervalVariable>& intervals, Model*
model);
58 explicit TaskSet(
int num_tasks) { sorted_tasks_.reserve(num_tasks); }
71 sorted_tasks_.clear();
72 optimized_restart_ = 0;
89 void Sort() { std::sort(sorted_tasks_.begin(), sorted_tasks_.end()); }
110 IntegerValue
ComputeEndMin(
int task_to_ignore,
int* critical_index)
const;
118 const std::vector<Entry>&
SortedTasks()
const {
return sorted_tasks_; }
121 std::vector<Entry> sorted_tasks_;
122 mutable int optimized_restart_ = 0;
140 task_to_event_.resize(helper_->
NumTasks());
146 bool PropagateSubwindow(IntegerValue global_window_end);
151 std::vector<
TaskTime> task_by_increasing_end_max_;
154 std::vector<
int> task_to_event_;
161 : time_direction_(time_direction),
163 task_set_(helper->NumTasks()) {}
168 bool PropagateSubwindow();
170 std::vector<
TaskTime> task_by_increasing_end_min_;
171 std::vector<
TaskTime> task_by_increasing_start_max_;
173 std::vector<
bool> processed_;
174 std::vector<
int> to_propagate_;
176 const
bool time_direction_;
193 template <
bool time_direction>
200 void AddNoOverlap(
const std::vector<IntervalVariable>&
var);
206 std::vector<std::vector<int>> task_to_disjunctives_;
207 std::vector<bool> task_is_added_;
208 std::vector<TaskSet> task_sets_;
209 std::vector<IntegerValue> end_mins_;
215 : time_direction_(time_direction),
217 task_set_(helper->NumTasks()) {}
222 bool PropagateSubwindow();
224 std::vector<
TaskTime> start_min_window_;
225 std::vector<
TaskTime> start_max_window_;
227 const
bool time_direction_;
236 : time_direction_(time_direction), helper_(helper) {}
241 bool PropagateSubwindow(IntegerValue window_end_min);
243 const
bool time_direction_;
247 std::vector<
TaskTime> task_by_increasing_end_max_;
252 std::vector<IntegerValue> event_size_;
255 std::vector<
int> non_gray_task_to_event_;
256 std::vector<
bool> is_gray_;
268 : time_direction_(time_direction),
270 integer_trail_(integer_trail),
271 precedences_(precedences),
272 task_set_(helper->NumTasks()),
273 task_to_arc_index_(helper->NumTasks()) {}
278 bool PropagateSubwindow();
280 const
bool time_direction_;
286 std::vector<IntegerVariable> index_to_end_vars_;
289 std::vector<
int> task_to_arc_index_;
AllIntervalsHelper(Model *model)
DisjunctiveDetectablePrecedences(bool time_direction, SchedulingConstraintHelper *helper)
DisjunctiveEdgeFinding(bool time_direction, SchedulingConstraintHelper *helper)
DisjunctiveNotLast(bool time_direction, SchedulingConstraintHelper *helper)
DisjunctiveOverloadChecker(SchedulingConstraintHelper *helper)
int RegisterWith(GenericLiteralWatcher *watcher)
DisjunctivePrecedences(bool time_direction, SchedulingConstraintHelper *helper, IntegerTrail *integer_trail, PrecedencesPropagator *precedences)
DisjunctiveWithTwoItems(SchedulingConstraintHelper *helper)
Class that owns everything related to a particular optimization model.
void AddUnsortedEntry(const Entry &e)
void NotifyEntryIsNowLastIfPresent(const Entry &e)
int GetCriticalIndex() const
void AddShiftedStartMinEntry(const SchedulingConstraintHelper &helper, int t)
IntegerValue ComputeEndMin() const
void AddEntry(const Entry &e)
const std::vector< Entry > & SortedTasks() const
void AddDisjunctiveWithBooleanPrecedencesOnly(const std::vector< IntervalVariable > &intervals, Model *model)
void AddDisjunctiveWithBooleanPrecedences(const std::vector< IntervalVariable > &intervals, Model *model)
std::function< void(Model *)> Disjunctive(const std::vector< IntervalVariable > &intervals)
Collection of objects used to extend the Constraint Solver library.
bool operator<(Entry other) const