Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

Alex020796
Copy link
Collaborator

We implemented a new dispatcher that minimizes the overall passenger travel time.

Copy link

github-actions bot commented May 15, 2024

Unit Test Results

138 tests  +18   132 ✅ +16   1m 22s ⏱️ +34s
  1 suites ± 0     4 💤 ± 0 
  1 files   ± 0     2 ❌ + 2 

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 fxjung self-assigned this May 15, 2024
@fxjung fxjung added enhancement New feature or request batteries as in 'batteries included' labels May 15, 2024
Copy link
Member

@fxjung fxjung left a 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
Copy link
Member

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
Copy link
Member

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 ...
Copy link
Member

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
Copy link
Member

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))
Copy link
Member

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?



@dispatcherclass
def MinimalPassengerTravelTimeDispatcher(
Copy link
Member

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:
Copy link
Member

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!!")
Copy link
Member

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!!")
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
batteries as in 'batteries included' enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants