Commit 418aafa 1 parent 766be56 commit 418aafa Copy full SHA for 418aafa
File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -225,14 +225,15 @@ bool CumulativeEnergyConstraint::Propagate() {
225
225
226
226
const int task_with_new_energy_max =
227
227
start_event_task_time_[event_with_new_energy_max].task_index ;
228
- helper_->AddStartMinReason (task_with_new_energy_max, window_start);
229
- helper_->AddEndMaxReason (task_with_new_energy_max, window_end);
230
- if (!demands_->DecreaseEnergyMax (task_with_new_energy_max,
231
- new_energy_max)) {
232
- return false ;
233
- }
234
-
235
228
if (helper_->IsPresent (task_with_new_energy_max)) {
229
+ helper_->AddPresenceReason (task_with_new_energy_max);
230
+ helper_->AddStartMinReason (task_with_new_energy_max, window_start);
231
+ helper_->AddEndMaxReason (task_with_new_energy_max, window_end);
232
+ if (!demands_->DecreaseEnergyMax (task_with_new_energy_max,
233
+ new_energy_max)) {
234
+ return false ;
235
+ }
236
+
236
237
theta_tree_.AddOrUpdateEvent (
237
238
task_to_start_event_[task_with_new_energy_max],
238
239
start_event_task_time_[event_with_new_energy_max].time *
You can’t perform that action at this time.
0 commit comments