14 #ifndef OR_TOOLS_SAT_TIMETABLE_H_
15 #define OR_TOOLS_SAT_TIMETABLE_H_
42 struct ProfileRectangle {
46 ProfileRectangle(IntegerValue start, IntegerValue height)
47 : start(start), height(height) {}
49 bool operator<(
const ProfileRectangle& other)
const {
50 return start < other.start;
60 void ReverseProfile();
65 bool SweepAllTasks(
bool is_forward);
68 bool SweepTask(
int task_id);
72 bool UpdateStartingTime(
int task_id, IntegerValue left, IntegerValue right);
76 bool IncreaseCapacity(IntegerValue
time, IntegerValue new_min);
81 void AddProfileReason(IntegerValue left, IntegerValue right);
83 IntegerValue CapacityMin()
const {
87 IntegerValue CapacityMax()
const {
91 IntegerValue DemandMin(
int task_id)
const {
92 return integer_trail_->
LowerBound(demands_[task_id]);
95 IntegerValue DemandMax(
int task_id)
const {
96 return integer_trail_->
UpperBound(demands_[task_id]);
100 bool IsInProfile(
int t)
const {
101 return positions_in_profile_tasks_[t] < num_profile_tasks_;
105 const int num_tasks_;
108 std::vector<AffineExpression> demands_;
117 std::vector<ProfileRectangle> profile_;
118 IntegerValue profile_max_height_;
122 IntegerValue starting_profile_height_;
128 std::vector<int> forward_tasks_to_sweep_;
129 std::vector<int> backward_tasks_to_sweep_;
130 int forward_num_tasks_to_sweep_;
131 int backward_num_tasks_to_sweep_;
137 std::vector<int> profile_tasks_;
138 std::vector<int> positions_in_profile_tasks_;
139 int num_profile_tasks_;
147 #endif // OR_TOOLS_SAT_TIMETABLE_H_