mila-iqia / COVI-AgentSim

Covid-19 spread simulator with human mobility and intervention modeling.
Other
20 stars 8 forks source link

0 length activities caused by mobility_planner._add_to_the_schedule() #101

Open aubreymcleod opened 2 years ago

aubreymcleod commented 2 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

add_to_the_schedule function constrains the end_time for tentative activities; if an activity's end_time would naturally fall during the closed_hours for its assigned location the activity has its end_time adjusted to the closed_hours. This function theoretically also restricts activities with a duration of zero from being added to the schedule.

Current Behavior

In the edge case where the activity starts at the closed_hour, the end_time will also be set to the closed_hour, and the activity will be added to the schedule. This in effect creates an activity with a duration of zero which is undesirable.

Failure Information

After inspecting add_to_the_schedule, it appears that this bug is caused by a missing '=' on line 1075 of the 'mobility_planner'. Where the start time is checked against the close time; currently '>', when probably should be '>='.