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. |
fxjung
left a comment
There was a problem hiding this comment.
I've just added some comments, maybe you can already have a look :)
| seat_capacity: int, | ||
| ) -> DispatcherSolution: | ||
| """ | ||
| #FIXME Add description |
| #FIXME Add description | ||
| """ | ||
| min_cost = np.inf | ||
| boolInsertEnd = True |
There was a problem hiding this comment.
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 ... |
| 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 |
| 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)) |
| best_pickup_idx : best_dropoff_idx + 1 | ||
| ] | ||
|
|
||
| # occupancies_ausschnitt = list(map(lambda x: x.occupancy_after_servicing, stoplist_request_in_vehicle)) |
|
|
||
|
|
||
| @dispatcherclass | ||
| def MinimalPassengerTravelTimeDispatcher( |
There was a problem hiding this comment.
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.
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.
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.
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.