Skip to content

Commit d7b91fa

Browse files
committed
fix bug in SIPP when a location has zero safe intervals
1 parent 19e3ade commit d7b91fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ReservationTable.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ void ReservationTable::insert2SIT(int location, int t_min, int t_max)
5858
it = sit[location].erase(it);
5959
}
6060
}
61+
if (sit[location].empty()) // the location is blocked for the entire time horizon
62+
sit[location].emplace_back(MAX_TIMESTEP, MAX_TIMESTEP, false); // insert a placeholder interval
6163
}
6264

6365
void ReservationTable::insertSoftConstraint2SIT(int location, int t_min, int t_max)
@@ -180,7 +182,7 @@ void ReservationTable::updateSIT(int location)
180182
{
181183
if (constraint_table.length_min > constraint_table.length_max) // the location is blocked for the entire time horizon
182184
{
183-
sit[location].emplace_back(0, 0, false);
185+
sit[location].emplace_back(MAX_TIMESTEP, MAX_TIMESTEP, false); // insert a placeholder interval
184186
return;
185187
}
186188
if (0 < constraint_table.length_min)

0 commit comments

Comments
 (0)