feat(drt): config-based prebooking logic per DRT mode (#4545)#4852
Merged
sebhoerl merged 3 commits intoApr 14, 2026
Merged
Conversation
Add config parameter sets to define prebooking logic type and parameters per DRT mode via config.xml, removing the need for programmatic installation. New parameter sets inside <parameterset type="prebooking">: - <parameterset type="logic:probability"> with probability and submissionSlack - <parameterset type="logic:attributes"> with configurable attribute name prefixes Changes: - PrebookingParams: extend ReflectiveConfigGroupWithConfigurableParameterSets, register both logic param sets (one-of-many pattern) - DrtModeQSimModule: auto-install prebooking logic when config params present - AttributeBasedPrebookingLogic: support configurable attribute name prefixes - New ProbabilityBasedPrebookingLogicParams and AttributeBasedPrebookingLogicParams - New PrebookingLogicConfigTest with 10 unit tests Fully backward compatible: existing programmatic install() calls still work. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….EPSILON Add configRoundTrip_multiModeDrt test verifying that two DRT modes with different prebooking logic types (probability-based and attribute-based) survive XML serialization/deserialization correctly. Replace all hardcoded epsilon values (1e-9, 1e-3) with MatsimTestUtils.EPSILON for consistency with MATSim test conventions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c575012 to
fb3f7b0
Compare
sebhoerl
approved these changes
Apr 14, 2026
Contributor
|
Looks great! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
When using multiple DRT modes with prebooking,
ProbabilityBasedPrebookingLogicandAttributeBasedPrebookingLogiccan only be installed programmatically viacontroller.addOverridingQSimModule(). TheprobabilityandsubmissionSlackvalues are passed as constructor arguments, with no way to set them per-mode inconfig.xml.Closes #4545
Change
Following @sebhoerl's suggestion, this adds two new nested parameter set types inside
<parameterset type="prebooking">:or
When a logic parameter set is present in config,
DrtModeQSimModuleauto-installs the corresponding logic -- no manualinstall()call needed.Design decisions
PrebookingParamsviaaddDefinition(), matching the existing pattern used byDrtConfigGroupfor insertion search params. Only one logic type can be active per mode.AttributeBasedPrebookingLogicnow supports configurable attribute name prefixes (defaults unchanged). This follows the suggestion that the attribute-based config should "just give the name of the attributes".install()calls continue to work. If no logic parameter set is configured, no logic is auto-installed.Changed files
PrebookingParams: register nested logic parameter setsDrtModeQSimModule: auto-install logic from configAttributeBasedPrebookingLogic: support configurable attribute prefixesNew files
ProbabilityBasedPrebookingLogicParams,AttributeBasedPrebookingLogicParams: config classesPrebookingLogicConfigTest: unit tests (config round-trip, end-to-end, one-of-many constraint)Tagging the original author @sebhoerl for review