From ec75934a515e77d5ef5eea0e0477cf6007c184f3 Mon Sep 17 00:00:00 2001 From: Kai Nagel Date: Thu, 8 Feb 2024 10:37:40 +0100 Subject: [PATCH] rename a method from add... to set... since that is what is does. --- .../java/org/matsim/contrib/drt/run/DrtConfigGroup.java | 9 +++++++++ .../main/java/org/matsim/contrib/drt/run/DrtConfigs.java | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigGroup.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigGroup.java index 7fb685bd92e..5ff7b530c23 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigGroup.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigGroup.java @@ -360,8 +360,17 @@ public Optional getPrebookingParams() { /** * Convenience method that brings syntax closer to syntax in, e.g., {@link RoutingConfigGroup} or {@link ScoringConfigGroup} + * + * @deprecated -- use {@link #setDrtInsertionSearchParams(DrtInsertionSearchParams) instead} */ + @Deprecated public final void addDrtInsertionSearchParams(final DrtInsertionSearchParams pars) { addParameterSet(pars); } + /** + * Convenience method that brings syntax closer to syntax in, e.g., {@link RoutingConfigGroup} or {@link ScoringConfigGroup} + */ + public final void setDrtInsertionSearchParams(final DrtInsertionSearchParams pars) { + addParameterSet(pars); + } } diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigs.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigs.java index dccfb2d7449..b358dc06576 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigs.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtConfigs.java @@ -32,18 +32,19 @@ public class DrtConfigs { private static final Logger LOGGER = LogManager.getLogger(DrtControlerCreator.class); public static void adjustMultiModeDrtConfig(MultiModeDrtConfigGroup multiModeDrtCfg, - ScoringConfigGroup planCalcScoreCfg, RoutingConfigGroup plansCalcRouteCfg) { + ScoringConfigGroup planCalcScoreCfg, RoutingConfigGroup plansCalcRouteCfg) { for (DrtConfigGroup drtCfg : multiModeDrtCfg.getModalElements()) { DrtConfigs.adjustDrtConfig(drtCfg, planCalcScoreCfg, plansCalcRouteCfg); } } public static void adjustDrtConfig(DrtConfigGroup drtCfg, ScoringConfigGroup planCalcScoreCfg, - RoutingConfigGroup plansCalcRouteCfg) { + RoutingConfigGroup plansCalcRouteCfg) { String drtStageActivityType = ScoringConfigGroup.createStageActivityType(drtCfg.getMode()); if (planCalcScoreCfg.getActivityParams(drtStageActivityType) == null) { addDrtStageActivityParams(planCalcScoreCfg, drtStageActivityType); } + // yyyy I think that the above functionality could/should be moved into the config consistency checker. kai, feb'24 } private static void addDrtStageActivityParams(ScoringConfigGroup planCalcScoreCfg, String stageActivityType) {