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

Adds tests to check if PersonCostEvents match their expected trip costs #3760

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

HoneyTauOverTwo
Copy link
Collaborator

@HoneyTauOverTwo HoneyTauOverTwo commented Jul 12, 2023

Expected costs are calculated by using their respective PathTraversalEvents


This change is Reviewable

…alculated by using their respective PathTraversalEvents.

This was made to cover a bug described on issue #3746.

This test will not be passing on this commit since the fix for issue #3746 is not being pushed alongside it.
@HoneyTauOverTwo HoneyTauOverTwo linked an issue Jul 12, 2023 that may be closed by this pull request
@HoneyTauOverTwo HoneyTauOverTwo changed the title Adds tests to check if PersonCostEvents match their expected trip costs calculated by using their respective PathTraversalEvents Adds tests to check if PersonCostEvents match their expected trip costs Jul 12, 2023
…ge meaning there are other sources for cost discrepancy.
@HoneyTauOverTwo HoneyTauOverTwo marked this pull request as draft July 12, 2023 19:02
@HoneyTauOverTwo HoneyTauOverTwo self-assigned this Jul 12, 2023
…discrepancy) and "currentTripCosts" from "BasePersonData":

Fixes "EmbodiedBeamLeg.splitLegForParking" which now properly evaluates the cost of each part of the splitted legs instead of assigning their full cost to the first part of the leg.

Removes "currentTripCosts: Double" field from BasePersonData and moves it to "def currentTripCosts()" that obtains the cost from "currentTrip: Option[EmbodiedBeamTrip]".

This field was causing unnecessary complexity to BasePersonData, since if at any point of the code currentTrip was modified but currentTripCosts was not updated to reflect these changes, these values would get out of sync.

Still have to increase PersonAgentTripCostTest coverage to see if the changes made on this commit that involve en-route code on PersonAgent.scala#L972 do not have adverse effects.
@HoneyTauOverTwo
Copy link
Collaborator Author

test!

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

Successfully merging this pull request may close these issues.

Incorrect pattern matching in PersonAgent.scala
1 participant