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

Should TransitDriverAgentImpl cache linkId (like PlanBasedDriverAgentImpl) ? #1338

Open
tschlenther opened this issue Jan 11, 2021 · 0 comments

Comments

@tschlenther
Copy link
Contributor

PlanBasedDriverAgentImpl caches the current link id, as chooseNextLinkId might be called several times in a row, without any move of the agent in between.
In the class PlanBasedDriverAgentImpl, comments suggest that this behavior/functionality should be ensured.

It seems that, until now, caching was not needed for TransitDriverAgentImpl, because chooseNextLinkId was only called once per link (but i am not even sure about that). This might change. One example:
We have recently changed the api of FlowEfficiencyCalculator, such that it has access to more information about the situation, a vehicle is in, just when the flow capacity consumption must be computed (see #1283 ). Related to that, it has access to the QVehicle (instead of the Vehicle). That allows the user to call qVehicle.getDriver().chooseNextLinkId() and get information about the turn direction of the vehicle and adjust the flow capacity consumption accordingly.

There seems to be more cases (that existed before #1283) in which chooseNextLinkId was called several times, at least for non-transit agents.

Should we introduce linkId-caching for them as well? Might have impacts on memory consumption.

Of cource, in implementations of FlowEfficiencyCalculator, one can simply check for QVehicle instance of TransitQVehicle, but that would not be a clean, sustainable solution in my opinion.

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

1 participant