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

update travelTime and cost of current stage #11838

Closed
rummel123 opened this issue Oct 14, 2022 · 4 comments
Closed

update travelTime and cost of current stage #11838

rummel123 opened this issue Oct 14, 2022 · 4 comments

Comments

@rummel123
Copy link
Contributor

traci.person.getStage(person_id, 0).length gives the current length of the already travelled way of the current stage.
traci.person.getStage(person_id, 0).travelTime and traci.person.getStage(person_id, 0).cost gives the default value -1073741824.0, due to the stage is not yet finished and will be calculated only when the stage is finished. It would be nice to update these values just as well the length to get the current travel time and current cost of the current stage.

@rummel123
Copy link
Contributor Author

I need this extension for the drtOrtools.py. Can I help somehow? In which file is it calculated?

@namdre
Copy link
Contributor

namdre commented Nov 4, 2022

libsumo/Person.cpp in getStage.
the traveltime can be computed from the depart time (time of entering the vehicle)
cost is usually identical to traveltime (except when using a very special router but that isn't applied to taxi routing.

@rummel123
Copy link
Contributor Author

I added the current travel time of the already traveled way of the current stage.
I don't how to add a test for that. I tested with my scenarios and it seems to work.

@rummel123
Copy link
Contributor Author

I found and adapted a suitable test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants