You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
PlanBasedDriverAgentImpl
caches the current link id, aschooseNextLinkId
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
, becausechooseNextLinkId
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 theQVehicle
(instead of theVehicle
). That allows the user to callqVehicle.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 forQVehicle
instance ofTransitQVehicle
, but that would not be a clean, sustainable solution in my opinion.The text was updated successfully, but these errors were encountered: