Skip to content

feat: Itinerary manager to enable itinerary modification#113

Open
erik-rosenstrom wants to merge 9 commits intoetr-school-closurefrom
etr-school-closure-draft-reactive
Open

feat: Itinerary manager to enable itinerary modification#113
erik-rosenstrom wants to merge 9 commits intoetr-school-closurefrom
etr-school-closure-draft-reactive

Conversation

@erik-rosenstrom
Copy link
Copy Markdown
Collaborator

@erik-rosenstrom erik-rosenstrom commented May 4, 2026

This PR implements an itinerary manager which modifies an individual's itinerary based on their person properties. The itinerary manager defines an itinerary modifier struct which has elements ranking, itinerary ratios, and modifier type. These modifiers are stored in a data plugin. The data plugin consists of a hashmap with the structure HashMap<Property<Person>, HashMap<Property<Person>::CanonicalValue, Vec[ItineraryModifier]>> This data structure enables multiple itinerary modifiers to be registered with a single person property. The following methods are implemented in a context trait extension to interact with this data plugin

  • register_itinerary_modifier: given a person property and value like Age(11) and an itinerary modifier, this method stores the person property and value and itinerary modifier in the data plugin. If an entry exists for the property and value the itinerary modifier is appended to the end of the vector.
  • remove_itinerary_modifier_by_property: removes the entire vector of itinerary modifiers associated with a property and value. This does not remove the property entry
  • remove_itinerary_modifier_by_property_and_type: removes a specific element with modifier_type from the vector associated with property and value
  • get_itinerary_modifiers: iterates over all property and values in the data plugin and assess if the person of interest matches the property values. It returns a vector of all itinerary modifiers that match the person.
  • get_dominant_itinerary_modifier: calls get_itinerary_modifiers sorts them by ranking and pops the highest ranking modifier

@erik-rosenstrom erik-rosenstrom force-pushed the etr-school-closure-draft-reactive branch from a56da6b to 6d10055 Compare May 4, 2026 20:57
@erik-rosenstrom erik-rosenstrom marked this pull request as draft May 5, 2026 13:55
@erik-rosenstrom erik-rosenstrom changed the base branch from main to etr-school-closure May 5, 2026 19:47
@erik-rosenstrom erik-rosenstrom marked this pull request as ready for review May 5, 2026 19:48
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.

1 participant