-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal Passenger Travel Time #261
base: master
Are you sure you want to change the base?
Conversation
Unit Test Results138 tests +18 132 ✅ +16 1m 22s ⏱️ +34s For more details on these failures, see this check. Results for commit d7b47fa. ± Comparison against base commit bf1863e. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just added some comments, maybe you can already have a look :)
seat_capacity: int, | ||
) -> DispatcherSolution: | ||
""" | ||
#FIXME Add description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be important :)
#FIXME Add description | ||
""" | ||
min_cost = np.inf | ||
boolInsertEnd = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use snake_case
for all Python variables instead of camelCase
, as per convention.
): | ||
# Time violation and seat capacity error not possilbe | ||
# As long as now drop-off time restriction is used | ||
# Ganz grosse Skepsis hier ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
stop_before_dropoff, time_to_dropoff, delta_cpat=0 | ||
) | ||
# Check time violations? | ||
# Hier muss ueberprueft werden, ob druch das einfügen irgendwo die seat capacity verletzt wird |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wird es?
stoplist_request_in_vehicle = stoplist[ | ||
best_pickup_idx : best_dropoff_idx + 1 | ||
] | ||
# occupancies_ausschnitt = list(map(lambda x: x.occupancy_after_servicing, stoplist_request_in_vehicle)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
best_pickup_idx : best_dropoff_idx + 1 | ||
] | ||
|
||
# occupancies_ausschnitt = list(map(lambda x: x.occupancy_after_servicing, stoplist_request_in_vehicle)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
|
||
|
||
@dispatcherclass | ||
def MinimalPassengerTravelTimeDispatcher( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is possibly not optimal. As far as I understand, the dispatcher only accepts requests for which both pick-up and delivery locations lie on existing vehicle routes, except if the request can be appended? Or did I confuse it? I didn't fully read the code, yet.
for x in stoplist_request_in_vehicle: | ||
occupancies_ausschnitt.append(x.occupancy_after_servicing) | ||
|
||
if seat_capacity in occupancies_ausschnitt: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
occupancies_ausschnitt
should be changed into some English word.
) | ||
for item in listOccupanciesNewStopList: | ||
if item > seat_capacity: | ||
print("Seat capacity error!!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this print statement. Normally, the dispatcher should not print anything. If indeed an unexpected error happens, this should be raised.
request_item = item.request | ||
if item.action.name == "pickup": | ||
if item.estimated_arrival_time > request_item.pickup_timewindow_max: | ||
print("Time violation!!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above: I don't understand this print statement. Normally, the dispatcher should not print anything. If indeed an unexpected error happens, this should be raised.
We implemented a new dispatcher that minimizes the overall passenger travel time.