14 #ifndef OR_TOOLS_SAT_DISJUNCTIVE_H_
15 #define OR_TOOLS_SAT_DISJUNCTIVE_H_
40 const std::vector<IntervalVariable>& vars);
46 const std::vector<IntervalVariable>& vars);
50 const std::vector<IntervalVariable>& vars);
58 explicit TaskSet(
int num_tasks) { sorted_tasks_.reserve(num_tasks); }
71 sorted_tasks_.clear();
72 optimized_restart_ = 0;
90 void Sort() { std::sort(sorted_tasks_.begin(), sorted_tasks_.end()); }
111 IntegerValue
ComputeEndMin(
int task_to_ignore,
int* critical_index)
const;
119 const std::vector<Entry>&
SortedTasks()
const {
return sorted_tasks_; }
122 std::vector<Entry> sorted_tasks_;
123 mutable int optimized_restart_ = 0;
141 task_to_event_.resize(helper_->
NumTasks());
147 bool PropagateSubwindow(IntegerValue global_window_end);
152 std::vector<
TaskTime> task_by_increasing_end_max_;
155 std::vector<
int> task_to_event_;
162 : time_direction_(time_direction),
164 task_set_(helper->NumTasks()) {}
169 bool PropagateSubwindow();
171 std::vector<
TaskTime> task_by_increasing_end_min_;
172 std::vector<
TaskTime> task_by_increasing_start_max_;
174 std::vector<
bool> processed_;
175 std::vector<
int> to_propagate_;
177 const
bool time_direction_;
194 template <
bool time_direction>
201 void AddNoOverlap(
const std::vector<IntervalVariable>&
var);
207 std::vector<std::vector<int>> task_to_disjunctives_;
208 std::vector<bool> task_is_added_;
209 std::vector<TaskSet> task_sets_;
210 std::vector<IntegerValue> end_mins_;
216 : time_direction_(time_direction),
218 task_set_(helper->NumTasks()) {}
223 bool PropagateSubwindow();
225 std::vector<
TaskTime> start_min_window_;
226 std::vector<
TaskTime> start_max_window_;
228 const
bool time_direction_;
237 : time_direction_(time_direction), helper_(helper) {}
242 bool PropagateSubwindow(IntegerValue window_end_min);
244 const
bool time_direction_;
248 std::vector<
TaskTime> task_by_increasing_end_max_;
253 std::vector<IntegerValue> event_size_;
256 std::vector<
int> non_gray_task_to_event_;
257 std::vector<
bool> is_gray_;
269 : time_direction_(time_direction),
271 integer_trail_(integer_trail),
272 precedences_(precedences),
273 task_set_(helper->NumTasks()),
274 task_to_arc_index_(helper->NumTasks()) {}
279 bool PropagateSubwindow();
281 const
bool time_direction_;
287 std::vector<IntegerVariable> index_to_end_vars_;
290 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)
void RemoveEntryWithIndex(int index)
int GetCriticalIndex() const
void AddShiftedStartMinEntry(const SchedulingConstraintHelper &helper, int t)
IntegerValue ComputeEndMin() const
void AddEntry(const Entry &e)
const std::vector< Entry > & SortedTasks() const
std::function< void(Model *)> DisjunctiveWithBooleanPrecedencesOnly(const std::vector< IntervalVariable > &vars)
std::function< void(Model *)> DisjunctiveWithBooleanPrecedences(const std::vector< IntervalVariable > &vars)
std::function< void(Model *)> Disjunctive(const std::vector< IntervalVariable > &vars)
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
bool operator<(Entry other) const