From 791f39b1fa4373fa0876ea344eb562fa55a6f3da Mon Sep 17 00:00:00 2001 From: rakow Date: Tue, 7 May 2024 11:42:07 +0200 Subject: [PATCH 1/7] try to avoid restrictions that lead to unreachable links, add option to remove disallowed links from network (#3257) --- .../prepare/network/CleanNetwork.java | 21 ++++++++++ .../contrib/sumo/SumoNetworkConverter.java | 42 ++++++++++++------- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/contribs/application/src/main/java/org/matsim/application/prepare/network/CleanNetwork.java b/contribs/application/src/main/java/org/matsim/application/prepare/network/CleanNetwork.java index 8b3e621ac22..64cef3959ac 100644 --- a/contribs/application/src/main/java/org/matsim/application/prepare/network/CleanNetwork.java +++ b/contribs/application/src/main/java/org/matsim/application/prepare/network/CleanNetwork.java @@ -1,8 +1,10 @@ package org.matsim.application.prepare.network; import org.matsim.api.core.v01.TransportMode; +import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; import org.matsim.application.MATSimAppCommand; +import org.matsim.core.network.DisallowedNextLinks; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.algorithms.MultimodalNetworkCleaner; import picocli.CommandLine; @@ -25,11 +27,30 @@ public class CleanNetwork implements MATSimAppCommand { @CommandLine.Option(names = "--modes", description = "List of modes to clean", split = ",", defaultValue = TransportMode.car) private Set modes; + @CommandLine.Option(names = "--remove-turn-restrictions", description = "Remove turn restrictions for specified modes.", defaultValue = "false") + private boolean rmTurnRestrictions; + + public static void main(String[] args) { + new CleanNetwork().execute(args); + } + @Override public Integer call() throws Exception { Network network = NetworkUtils.readNetwork(input.toString()); + if (rmTurnRestrictions) { + for (Link link : network.getLinks().values()) { + DisallowedNextLinks disallowed = NetworkUtils.getDisallowedNextLinks(link); + if (disallowed != null) { + modes.forEach(disallowed::removeDisallowedLinkSequences); + if (disallowed.isEmpty()) { + NetworkUtils.removeDisallowedNextLinks(link); + } + } + } + } + var cleaner = new MultimodalNetworkCleaner(network); for (String m : modes) { diff --git a/contribs/sumo/src/main/java/org/matsim/contrib/sumo/SumoNetworkConverter.java b/contribs/sumo/src/main/java/org/matsim/contrib/sumo/SumoNetworkConverter.java index 592243b1310..378703db1eb 100644 --- a/contribs/sumo/src/main/java/org/matsim/contrib/sumo/SumoNetworkConverter.java +++ b/contribs/sumo/src/main/java/org/matsim/contrib/sumo/SumoNetworkConverter.java @@ -5,7 +5,6 @@ import org.apache.commons.csv.CSVPrinter; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.locationtech.jts.geom.Geometry; import org.matsim.api.core.v01.Coord; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.TransportMode; @@ -21,7 +20,6 @@ import org.matsim.core.scenario.ProjectionUtils; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.core.utils.geometry.transformations.TransformationFactory; -import org.matsim.core.utils.gis.GeoFileReader; import org.matsim.core.utils.io.IOUtils; import org.xml.sax.SAXException; import picocli.CommandLine; @@ -70,8 +68,8 @@ private SumoNetworkConverter(List input, Path output, String fromCRS, Stri this.fromCRS = fromCRS; this.toCRS = toCRS; this.freeSpeedFactor = freeSpeedFactor; - this.laneRestriction = laneRestriction; - } + this.laneRestriction = laneRestriction; + } private SumoNetworkConverter() { } @@ -119,14 +117,6 @@ public static void main(String[] args) { System.exit(new CommandLine(new SumoNetworkConverter()).execute(args)); } - /** - * Network area based on the cut-out. - */ - private static Geometry calculateNetworkArea(Path shapeFile) { - // only the first feature is used - return ((Geometry) GeoFileReader.getAllFeatures(shapeFile.toString()).iterator().next().getDefaultGeometry()); - } - /** * Determine if a mode is allowed on a link. */ @@ -342,6 +332,9 @@ public SumoNetworkHandler convert(Network network) throws ParserConfigurationExc Set> ignored = new HashSet<>(); + // map of link and source link that are restricted + Map, Set>> restrictions = new HashMap<>(); + for (Map.Entry> kv : sumoHandler.connections.entrySet()) { Link link = network.getLinks().get(Id.createLinkId(kv.getKey())); @@ -350,16 +343,30 @@ public SumoNetworkHandler convert(Network network) throws ParserConfigurationExc Set> outLinks = link.getToNode().getOutLinks().keySet(); Set> allowed = kv.getValue().stream().map(c -> Id.createLinkId(c.to)).collect(Collectors.toSet()); - Sets.SetView> diff = Sets.difference(outLinks, allowed); + // Disallowed link ids + Sets.SetView> dis = Sets.difference(outLinks, allowed); - if (outLinks.size() == diff.size()) { + if (outLinks.size() == dis.size()) { ignored.add(link.getId()); continue; } - if (!diff.isEmpty()) { + if (!dis.isEmpty()) { DisallowedNextLinks disallowed = new DisallowedNextLinks(); - for (Id id : diff) { + for (Id id : dis) { + + Set> restricted = restrictions.computeIfAbsent(id, (k) -> new HashSet<>()); + + Link targetLink = network.getLinks().get(id); + Map, ? extends Link> turnLinks = targetLink.getFromNode().getOutLinks(); + + // Ensure that a link is always reachable from at least one other link + if (turnLinks.size() - 1 <= restricted.size()) { + ignored.add(id); + continue; + } + + restricted.add(link.getId()); disallowed.addDisallowedLinkSequence(TransportMode.car, List.of(id)); } @@ -368,6 +375,9 @@ public SumoNetworkHandler convert(Network network) throws ParserConfigurationExc } } + // clean again (possibly with turn restrictions) + new NetworkCleaner().run(network); + if (!ignored.isEmpty()) { log.warn("Ignored turn restrictions for {} links with no connections: {}", ignored.size(), ignored); } From bdf21825900f0178dc712d21d5d14de027b52e85 Mon Sep 17 00:00:00 2001 From: Mark Frawley <158592560+mfrawley-moia@users.noreply.github.com> Date: Tue, 7 May 2024 19:45:51 +0200 Subject: [PATCH 2/7] fix: personMoney event reference lookup missing in EventsReader (#3258) --- .../matsim/core/events/EventsReaderXMLv1.java | 34 +++++++++--------- .../matsim/core/events/EventsReadersTest.java | 36 +++++++++---------- .../core/events/EventsReadersTest/events.xml | 3 +- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/matsim/src/main/java/org/matsim/core/events/EventsReaderXMLv1.java b/matsim/src/main/java/org/matsim/core/events/EventsReaderXMLv1.java index 16a70f3946d..dc5bc26a03a 100644 --- a/matsim/src/main/java/org/matsim/core/events/EventsReaderXMLv1.java +++ b/matsim/src/main/java/org/matsim/core/events/EventsReaderXMLv1.java @@ -101,25 +101,25 @@ private void startEvent(final Attributes atts) { // === material related to wait2link below here === if (LinkLeaveEvent.EVENT_TYPE.equals(eventType)) { - this.events.processEvent(new LinkLeaveEvent(time, - Id.create(atts.getValue(LinkLeaveEvent.ATTRIBUTE_VEHICLE), Vehicle.class), + this.events.processEvent(new LinkLeaveEvent(time, + Id.create(atts.getValue(LinkLeaveEvent.ATTRIBUTE_VEHICLE), Vehicle.class), Id.create(atts.getValue(LinkLeaveEvent.ATTRIBUTE_LINK), Link.class) // had driver id in previous version )); } else if (LinkEnterEvent.EVENT_TYPE.equals(eventType)) { - this.events.processEvent(new LinkEnterEvent(time, - Id.create(atts.getValue(LinkEnterEvent.ATTRIBUTE_VEHICLE), Vehicle.class), + this.events.processEvent(new LinkEnterEvent(time, + Id.create(atts.getValue(LinkEnterEvent.ATTRIBUTE_VEHICLE), Vehicle.class), Id.create(atts.getValue(LinkEnterEvent.ATTRIBUTE_LINK), Link.class) // had driver id in previous version )); } else if (VehicleEntersTrafficEvent.EVENT_TYPE.equals(eventType) ) { // (this is the new version, marked by the new events name) - this.events.processEvent(new VehicleEntersTrafficEvent(time, + this.events.processEvent(new VehicleEntersTrafficEvent(time, Id.create(atts.getValue(HasPersonId.ATTRIBUTE_PERSON), Person.class), - Id.create(atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_LINK), Link.class), + Id.create(atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_LINK), Link.class), Id.create(atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_VEHICLE), Vehicle.class), - atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_NETWORKMODE), + atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_NETWORKMODE), Double.parseDouble( atts.getValue( VehicleEntersTrafficEvent.ATTRIBUTE_POSITION) ) )); } else if ( "wait2link".equals(eventType) ) { @@ -140,19 +140,19 @@ private void startEvent(final Attributes atts) { } else { position = 1.0 ; } - this.events.processEvent(new VehicleEntersTrafficEvent(time, + this.events.processEvent(new VehicleEntersTrafficEvent(time, Id.create(atts.getValue(HasPersonId.ATTRIBUTE_PERSON), Person.class), - Id.create(atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_LINK), Link.class), + Id.create(atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_LINK), Link.class), vehicleId, - atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_NETWORKMODE), + atts.getValue(VehicleEntersTrafficEvent.ATTRIBUTE_NETWORKMODE), position )); } else if (VehicleLeavesTrafficEvent.EVENT_TYPE.equals(eventType)) { - this.events.processEvent(new VehicleLeavesTrafficEvent(time, - Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_DRIVER), Person.class), - Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_LINK), Link.class), - atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_VEHICLE) == null ? null : Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_VEHICLE), Vehicle.class), - atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_NETWORKMODE), + this.events.processEvent(new VehicleLeavesTrafficEvent(time, + Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_DRIVER), Person.class), + Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_LINK), Link.class), + atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_VEHICLE) == null ? null : Id.create(atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_VEHICLE), Vehicle.class), + atts.getValue(VehicleLeavesTrafficEvent.ATTRIBUTE_NETWORKMODE), Double.parseDouble( atts.getValue( VehicleLeavesTrafficEvent.ATTRIBUTE_POSITION) ) )); } @@ -165,7 +165,7 @@ else if (ActivityEndEvent.EVENT_TYPE.equals(eventType)) { coord = new Coord( xx, yy ) ; } this.events.processEvent(new ActivityEndEvent( - time, + time, Id.create(atts.getValue(HasPersonId.ATTRIBUTE_PERSON), Person.class), Id.create(atts.getValue(HasLinkId.ATTRIBUTE_LINK), Link.class), atts.getValue(HasFacilityId.ATTRIBUTE_FACILITY) == null ? null : Id.create(atts.getValue(HasFacilityId.ATTRIBUTE_FACILITY), @@ -208,7 +208,7 @@ else if (ActivityEndEvent.EVENT_TYPE.equals(eventType)) { Id linkId = linkIdString == null ? null : Id.create(linkIdString, Link.class); this.events.processEvent(new VehicleAbortsEvent(time, Id.create(atts.getValue(VehicleAbortsEvent.ATTRIBUTE_VEHICLE), Vehicle.class), linkId)); } else if (PersonMoneyEvent.EVENT_TYPE.equals(eventType) || "agentMoney".equals(eventType)) { - this.events.processEvent(new PersonMoneyEvent(time, Id.create(atts.getValue(PersonMoneyEvent.ATTRIBUTE_PERSON), Person.class), Double.parseDouble(atts.getValue(PersonMoneyEvent.ATTRIBUTE_AMOUNT)), atts.getValue(PersonMoneyEvent.ATTRIBUTE_PURPOSE), atts.getValue(PersonMoneyEvent.ATTRIBUTE_TRANSACTION_PARTNER))); + this.events.processEvent(new PersonMoneyEvent(time, Id.create(atts.getValue(PersonMoneyEvent.ATTRIBUTE_PERSON), Person.class), Double.parseDouble(atts.getValue(PersonMoneyEvent.ATTRIBUTE_AMOUNT)), atts.getValue(PersonMoneyEvent.ATTRIBUTE_PURPOSE), atts.getValue(PersonMoneyEvent.ATTRIBUTE_TRANSACTION_PARTNER), atts.getValue(PersonMoneyEvent.ATTRIBUTE_REFERENCE))); } else if (PersonScoreEvent.EVENT_TYPE.equals(eventType) || "personScore".equals(eventType)) { this.events.processEvent(new PersonScoreEvent(time, Id.create(atts.getValue(PersonScoreEvent.ATTRIBUTE_PERSON), Person.class), Double.parseDouble(atts.getValue(PersonScoreEvent.ATTRIBUTE_AMOUNT)), atts.getValue(PersonScoreEvent.ATTRIBUTE_KIND))); } else if (PersonEntersVehicleEvent.EVENT_TYPE.equals(eventType)) { diff --git a/matsim/src/test/java/org/matsim/core/events/EventsReadersTest.java b/matsim/src/test/java/org/matsim/core/events/EventsReadersTest.java index 3bbf1a1626a..e8ea4f9a069 100644 --- a/matsim/src/test/java/org/matsim/core/events/EventsReadersTest.java +++ b/matsim/src/test/java/org/matsim/core/events/EventsReadersTest.java @@ -29,22 +29,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; -import org.matsim.api.core.v01.events.ActivityEndEvent; -import org.matsim.api.core.v01.events.ActivityStartEvent; -import org.matsim.api.core.v01.events.LinkEnterEvent; -import org.matsim.api.core.v01.events.LinkLeaveEvent; -import org.matsim.api.core.v01.events.PersonArrivalEvent; -import org.matsim.api.core.v01.events.PersonDepartureEvent; -import org.matsim.api.core.v01.events.PersonStuckEvent; -import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent; -import org.matsim.api.core.v01.events.handler.ActivityEndEventHandler; -import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler; -import org.matsim.api.core.v01.events.handler.LinkEnterEventHandler; -import org.matsim.api.core.v01.events.handler.LinkLeaveEventHandler; -import org.matsim.api.core.v01.events.handler.PersonArrivalEventHandler; -import org.matsim.api.core.v01.events.handler.PersonDepartureEventHandler; -import org.matsim.api.core.v01.events.handler.PersonStuckEventHandler; -import org.matsim.api.core.v01.events.handler.VehicleEntersTrafficEventHandler; +import org.matsim.api.core.v01.TransportMode; +import org.matsim.api.core.v01.events.*; +import org.matsim.api.core.v01.events.handler.*; import org.matsim.api.core.v01.network.Link; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.testcases.MatsimTestUtils; @@ -60,7 +47,7 @@ public class EventsReadersTest { static class TestHandler implements ActivityEndEventHandler, PersonDepartureEventHandler, VehicleEntersTrafficEventHandler, LinkLeaveEventHandler, LinkEnterEventHandler, PersonArrivalEventHandler, ActivityStartEventHandler, - PersonStuckEventHandler { + PersonStuckEventHandler, PersonMoneyEventHandler { public int eventCounter = 0; @@ -141,6 +128,17 @@ public void handleEvent(final PersonStuckEvent event) { assertEquals("9", event.getLinkId().toString()); } + @Override + public void handleEvent(final PersonMoneyEvent event) { + this.eventCounter++; + assertEquals(9, this.eventCounter, "expected personMoney-Event to be event #9"); + assertEquals(21690.0, event.getTime(), 0.0); + assertEquals("9", event.getPersonId().toString()); + assertEquals("drtFare", event.getPurpose()); + assertEquals(TransportMode.drt, event.getTransactionPartner()); + assertEquals(-1.0, event.getAmount(), 0.0); + assertEquals("drt_0", event.getReference()); + } } @Test @@ -152,7 +150,7 @@ final void testXmlReader() throws SAXException, ParserConfigurationException, IO EventsReaderXMLv1 reader = new EventsReaderXMLv1(events); reader.readFile(utils.getClassInputDirectory() + "events.xml"); events.finishProcessing(); - assertEquals(8, handler.eventCounter, "number of read events"); + assertEquals(9, handler.eventCounter, "number of read events"); } @Test @@ -164,6 +162,6 @@ final void testAutoFormatReaderXml() { MatsimEventsReader reader = new MatsimEventsReader(events); reader.readFile(utils.getClassInputDirectory() + "events.xml"); events.finishProcessing(); - assertEquals(8, handler.eventCounter, "number of read events"); + assertEquals(9, handler.eventCounter, "number of read events"); } } diff --git a/matsim/src/test/resources/test/input/org/matsim/core/events/EventsReadersTest/events.xml b/matsim/src/test/resources/test/input/org/matsim/core/events/EventsReadersTest/events.xml index d73dc9a2f37..260841c6768 100644 --- a/matsim/src/test/resources/test/input/org/matsim/core/events/EventsReadersTest/events.xml +++ b/matsim/src/test/resources/test/input/org/matsim/core/events/EventsReadersTest/events.xml @@ -9,4 +9,5 @@ - \ No newline at end of file + + From ca38361bd2e30a1263190e795abc0f595c57335d Mon Sep 17 00:00:00 2001 From: Paul Heinrich Date: Wed, 8 May 2024 16:02:33 +0200 Subject: [PATCH 3/7] add routing test with multiple same options --- .../AbstractLeastCostPathCalculatorTest.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/matsim/src/test/java/org/matsim/core/router/AbstractLeastCostPathCalculatorTest.java b/matsim/src/test/java/org/matsim/core/router/AbstractLeastCostPathCalculatorTest.java index 0bb049ca193..2c59cad79d6 100644 --- a/matsim/src/test/java/org/matsim/core/router/AbstractLeastCostPathCalculatorTest.java +++ b/matsim/src/test/java/org/matsim/core/router/AbstractLeastCostPathCalculatorTest.java @@ -24,11 +24,13 @@ import javax.xml.parsers.ParserConfigurationException; +import org.apache.logging.log4j.LogManager; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.Identifiable; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; @@ -92,4 +94,31 @@ void testCalcLeastCostPath_SameFromTo() throws SAXException, ParserConfiguration assertEquals(network.getNodes().get(Id.create("12", Node.class)), path.nodes.get(0)); } + @Test + void testCalcLeastCostPath_withOptions() throws SAXException, ParserConfigurationException, IOException { + Config config = utils.loadConfig((String)null); + Scenario scenario = ScenarioUtils.createScenario(config); + Network network = scenario.getNetwork(); + new MatsimNetworkReader(scenario.getNetwork()).readFile("test/scenarios/equil/network.xml"); + + //path from 1 to 13 has several options with the same travel time + Node node1 = network.getNodes().get(Id.create("1", Node.class)); + Node node13 = network.getNodes().get(Id.create("13", Node.class)); + + LeastCostPathCalculator routerAlgo = getLeastCostPathCalculator(network); + Path path = routerAlgo.calcLeastCostPath(node1, node13, 8.0*3600, null, null); + + assertEquals(5, path.nodes.size(), "number of nodes wrong."); + assertEquals(4, path.links.size(), "number of links wrong."); + assertEquals(network.getNodes().get(Id.create("1", Node.class)), path.nodes.get(0)); + assertEquals(network.getNodes().get(Id.create("2", Node.class)), path.nodes.get(1)); + assertEquals(network.getNodes().get(Id.create("3", Node.class)), path.nodes.get(2)); + assertEquals(network.getNodes().get(Id.create("12", Node.class)), path.nodes.get(3)); + assertEquals(network.getNodes().get(Id.create("13", Node.class)), path.nodes.get(4)); + assertEquals(network.getLinks().get(Id.create("1", Link.class)), path.links.get(0)); + assertEquals(network.getLinks().get(Id.create("2", Link.class)), path.links.get(1)); + assertEquals(network.getLinks().get(Id.create("11", Link.class)), path.links.get(2)); + assertEquals(network.getLinks().get(Id.create("20", Link.class)), path.links.get(3)); + } + } From 9f92c118f279844512f855f3711c220a95eeb71e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 19:34:54 +0000 Subject: [PATCH 4/7] build(deps): bump info.picocli:picocli from 4.7.5 to 4.7.6 Bumps [info.picocli:picocli](https://github.com/remkop/picocli) from 4.7.5 to 4.7.6. - [Release notes](https://github.com/remkop/picocli/releases) - [Changelog](https://github.com/remkop/picocli/blob/main/RELEASE-NOTES.md) - [Commits](https://github.com/remkop/picocli/compare/v4.7.5...v4.7.6) --- updated-dependencies: - dependency-name: info.picocli:picocli dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- contribs/application/pom.xml | 2 +- contribs/sumo/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contribs/application/pom.xml b/contribs/application/pom.xml index 95ea86036d9..c8be94e15cf 100644 --- a/contribs/application/pom.xml +++ b/contribs/application/pom.xml @@ -117,7 +117,7 @@ info.picocli picocli - 4.7.5 + 4.7.6 it.unimi.dsi diff --git a/contribs/sumo/pom.xml b/contribs/sumo/pom.xml index d55aa642bf5..da11bdf4865 100644 --- a/contribs/sumo/pom.xml +++ b/contribs/sumo/pom.xml @@ -23,7 +23,7 @@ info.picocli picocli - 4.7.5 + 4.7.6 From 4e0312173f64fe29ee35dc78cd5f87a912d6852e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 19:49:49 +0000 Subject: [PATCH 5/7] build(deps-dev): bump net.bytebuddy:byte-buddy from 1.14.14 to 1.14.15 Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.14.14 to 1.14.15. - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.14.14...byte-buddy-1.14.15) --- updated-dependencies: - dependency-name: net.bytebuddy:byte-buddy dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2a0c1c1c6f..d79e8231281 100644 --- a/pom.xml +++ b/pom.xml @@ -353,7 +353,7 @@ net.bytebuddy byte-buddy - 1.14.14 + 1.14.15 test From 0f8e4823ae15088e7d4ad541dd5585e974635a3a Mon Sep 17 00:00:00 2001 From: Kai Nagel Date: Thu, 9 May 2024 08:17:58 +0200 Subject: [PATCH 6/7] add javadoc comment to constructor of OTFVisLiveModule --- .../emissions/utils/EmissionsConfigGroup.java | 2 +- .../matsim/contrib/otfvis/OTFVisLiveModule.java | 11 +++++++++++ .../vsp/pt/fare/PtFareConfigGroup.java | 17 ++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/utils/EmissionsConfigGroup.java b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/utils/EmissionsConfigGroup.java index e5092b57568..f7107ece5f0 100644 --- a/contribs/emissions/src/main/java/org/matsim/contrib/emissions/utils/EmissionsConfigGroup.java +++ b/contribs/emissions/src/main/java/org/matsim/contrib/emissions/utils/EmissionsConfigGroup.java @@ -172,7 +172,7 @@ public URL getAverageColdEmissionFactorsFileURL(URL context) { // =============== // =============== /** - * @param detailedVsAverageLookupBehavior -- {@value #DETAILED_VS_AVERAGE_LOOKUP_BEHAVIOR_CMT} + * @param detailedVsAverageLookupBehavior -- {@value #DETAILED_VS_AVERAGE_LOOKUP_BEHAVIOR_CMT} * @noinspection JavadocReference */ @StringSetter(DETAILED_VS_AVERAGE_LOOKUP_BEHAVIOR) diff --git a/contribs/otfvis/src/main/java/org/matsim/contrib/otfvis/OTFVisLiveModule.java b/contribs/otfvis/src/main/java/org/matsim/contrib/otfvis/OTFVisLiveModule.java index 001f4a227b3..7d9cfa12823 100644 --- a/contribs/otfvis/src/main/java/org/matsim/contrib/otfvis/OTFVisLiveModule.java +++ b/contribs/otfvis/src/main/java/org/matsim/contrib/otfvis/OTFVisLiveModule.java @@ -37,6 +37,17 @@ import com.google.inject.Inject; public class OTFVisLiveModule extends AbstractModule { + + /** + * For win, one needs to add + * + * --add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.java2d=ALL-UNNAMED + * + * as arguments to the JVM to get around module protection. + */ + public OTFVisLiveModule() { + // so I can attach javadoc to this. kai, may'24 + } @Override public void install() { diff --git a/contribs/vsp/src/main/java/playground/vsp/pt/fare/PtFareConfigGroup.java b/contribs/vsp/src/main/java/playground/vsp/pt/fare/PtFareConfigGroup.java index b463d323fc6..20c9291dc1b 100644 --- a/contribs/vsp/src/main/java/playground/vsp/pt/fare/PtFareConfigGroup.java +++ b/contribs/vsp/src/main/java/playground/vsp/pt/fare/PtFareConfigGroup.java @@ -15,6 +15,12 @@ public class PtFareConfigGroup extends ReflectiveConfigGroup { public enum PtFareCalculationModels {distanceBased} // More to come (e.g. zone based, hybrid...) + private static final String PT_FARE_CALCULATION_CMT = "PT fare calculation scheme. Current implementation: distanceBased (more to come...)"; + public static final String UPPER_BOUND_FACTOR_CMT = "When upper bound is applied, upperBound = upperBoundFactor * max Fare of the day. " + + "This value is decided by the ratio between average daily cost of a ticket subscription and the single " + + "trip ticket of the same trip. Usually this value should be somewhere between 1.0 and 2.0"; + public static final String APPLY_UPPER_BOUND_CMT = "Enable the upper bound for daily PT fare to count for ticket subscription. Input value: true or false"; + private PtFareCalculationModels ptFareCalculation = PtFareCalculationModels.distanceBased; // Use distance based calculation by default private boolean applyUpperBound = true; @PositiveOrZero @@ -27,11 +33,9 @@ public PtFareConfigGroup() { @Override public Map getComments() { Map map = super.getComments(); - map.put(PT_FARE_CALCULATION, "PT fare calculation scheme. Current implementation: distanceBased (more to come...)"); - map.put(APPLY_UPPER_BOUND, "Enable the upper bound for daily PT fare to count for ticket subscription. Input value: true or false"); - map.put(UPPER_BOUND_FACTOR, "When upper bound is applied, upperBound = upperBoundFactor * max Fare of the day. " + - "This value is decided by the ratio between average daily cost of a ticket subscription and the single " + - "trip ticket of the same trip. Usually this value should be somewhere between 1.0 and 2.0"); + map.put(PT_FARE_CALCULATION, PT_FARE_CALCULATION_CMT ); + map.put(APPLY_UPPER_BOUND, APPLY_UPPER_BOUND_CMT ); + map.put(UPPER_BOUND_FACTOR, UPPER_BOUND_FACTOR_CMT ); return map; } @@ -61,6 +65,9 @@ public double getUpperBoundFactor() { return upperBoundFactor; } + /** + * @param upperBoundFactor -- {@value #UPPER_BOUND_FACTOR_CMT} + */ @StringSetter(UPPER_BOUND_FACTOR) public void setUpperBoundFactor(double upperBoundFactor) { this.upperBoundFactor = upperBoundFactor; From 138f63a413f71190f3ac7bc93d1d9c1a8fdfefc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20K=C3=BChnel?= Date: Fri, 10 May 2024 15:10:45 +0200 Subject: [PATCH 7/7] factor out drt optimization constraint params from drt config group (#3252) * factor out drt optimization constraint params from drt config group as preparatory work for service differentiation * ensure backwards compatibility with previous drt config design --- .../examples/RunJointDemandDRTExample.java | 6 +- .../edrt/run/EDrtModeOptimizerQSimModule.java | 4 +- .../extension/fiss/RunFissDrtScenarioIT.java | 10 +- .../eshifts/run/RunEShiftDrtScenarioIT.java | 12 +- .../run/RunMultiHubShiftDrtScenarioIT.java | 12 +- .../shifts/run/RunShiftDrtScenarioIT.java | 12 +- .../DrtAnalysisControlerListener.java | 6 +- .../impl/PessimisticDrtEstimator.java | 9 +- .../optimizer/DrtModeOptimizerQSimModule.java | 4 +- .../contrib/drt/routing/DrtRouteCreator.java | 6 +- .../contrib/drt/run/DrtConfigGroup.java | 138 ++++++------------ .../contrib/drt/run/DrtModeRoutingModule.java | 2 +- .../run/DrtOptimizationConstraintsParams.java | 96 ++++++++++++ .../optimizer/MaxDetourConstraintTest.java | 14 +- .../insertion/DrtPoolingParameterTest.java | 6 +- .../prebooking/ComplexUnschedulerTest.java | 2 +- .../prebooking/PrebookingTestEnvironment.java | 6 +- .../drt/routing/DrtRoutingModuleTest.java | 10 +- .../drt/run/examples/RunDrtExampleIT.java | 10 +- .../RunOldDrtConfigCompatibilityIT.java | 61 ++++++++ .../teleportation/DrtTeleportationTest.java | 12 +- .../contrib/taxi/run/MultiModeTaxiModule.java | 12 +- .../drtAndPt/PtAlongALine2Test.java | 24 +-- .../drtAndPt/PtAlongALineTest.java | 16 +- .../dvrp-grid/eight_shared_taxi_config.xml | 10 +- .../multi_mode_one_shared_taxi_config.xml | 20 ++- .../dvrp-grid/one_shared_taxi_config.xml | 10 +- .../one_taxi_and_one_shared_taxi_config.xml | 9 +- .../scenarios/kelheim/config-with-drt.xml | 40 ++--- .../scenarios/mielec/mielec_drt_config.xml | 8 +- .../scenarios/mielec/mielec_drt_config_v1.xml | 72 +++++++++ .../scenarios/mielec/mielec_edrt_config.xml | 8 +- .../mielec/mielec_multiModeEdrt_config.xml | 16 +- .../mielec_serviceArea_based_drt_config.xml | 9 +- .../mielec/mielec_stop_based_drt_config.xml | 12 +- 35 files changed, 462 insertions(+), 242 deletions(-) create mode 100644 contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtOptimizationConstraintsParams.java create mode 100644 contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunOldDrtConfigCompatibilityIT.java create mode 100644 examples/scenarios/mielec/mielec_drt_config_v1.xml diff --git a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java index 72144a8d440..4379075dc79 100644 --- a/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java +++ b/contribs/commercialTrafficApplications/src/main/java/org/matsim/contrib/commercialTrafficApplications/jointDemand/examples/RunJointDemandDRTExample.java @@ -141,9 +141,9 @@ private static void loadConfigGroups(Config config) { MultiModeDrtConfigGroup multiModeDrtConfigGroup = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class); DrtConfigGroup drtCfg = new DrtConfigGroup(); - drtCfg.maxWaitTime = 2 * 3600; - drtCfg.maxTravelTimeAlpha = 5; - drtCfg.maxTravelTimeBeta = 15 * 60; + drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime = 2 * 3600; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 5; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 15 * 60; drtCfg.stopDuration = 60; drtCfg.vehiclesFile = "jointDemand_vehicles.xml"; multiModeDrtConfigGroup.addParameterSet(drtCfg); diff --git a/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/edrt/run/EDrtModeOptimizerQSimModule.java b/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/edrt/run/EDrtModeOptimizerQSimModule.java index b617a93a0d3..5333231bd6a 100644 --- a/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/edrt/run/EDrtModeOptimizerQSimModule.java +++ b/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/edrt/run/EDrtModeOptimizerQSimModule.java @@ -147,7 +147,7 @@ public EmptyVehicleChargingScheduler get() { bindModal(VehicleEntry.EntryFactory.class).toProvider( EDrtVehicleDataEntryFactory.EDrtVehicleDataEntryFactoryProvider.class).asEagerSingleton(); - bindModal(CostCalculationStrategy.class).to(drtCfg.rejectRequestIfMaxWaitOrTravelTimeViolated ? + bindModal(CostCalculationStrategy.class).to(drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated ? CostCalculationStrategy.RejectSoftConstraintViolations.class : CostCalculationStrategy.DiscourageSoftConstraintViolations.class).asEagerSingleton(); @@ -179,7 +179,7 @@ public EmptyVehicleRelocator get() { getter.getModal(StopTimeCalculator.class), scheduleWaitBeforeDrive))) .asEagerSingleton(); - bindModal(DefaultOfferAcceptor.class).toProvider(modalProvider(getter -> new DefaultOfferAcceptor(drtCfg.maxAllowedPickupDelay))); + bindModal(DefaultOfferAcceptor.class).toProvider(modalProvider(getter -> new DefaultOfferAcceptor(drtCfg.getDrtOptimizationConstraintsParam().maxAllowedPickupDelay))); bindModal(DrtOfferAcceptor.class).to(modalKey(DefaultOfferAcceptor.class)); bindModal(ScheduleTimingUpdater.class).toProvider(modalProvider( diff --git a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/fiss/RunFissDrtScenarioIT.java b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/fiss/RunFissDrtScenarioIT.java index d9eda86cc8b..29f2a9b006d 100644 --- a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/fiss/RunFissDrtScenarioIT.java +++ b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/fiss/RunFissDrtScenarioIT.java @@ -53,16 +53,16 @@ void test() { DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup; drtConfigGroup.mode = TransportMode.drt; - drtConfigGroup.maxTravelTimeAlpha = 1.5; - drtConfigGroup.maxTravelTimeBeta = 10. * 60.; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.; drtConfigGroup.stopDuration = 30.; - drtConfigGroup.maxWaitTime = 600.; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = true; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 600.; + drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = true; drtConfigGroup.useModeFilteredSubnetwork = false; drtConfigGroup.vehiclesFile = fleetFile; drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door; drtConfigGroup.plotDetailedCustomerStats = true; - drtConfigGroup.maxWalkDistance = 1000.; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 1000.; drtConfigGroup.idleVehiclesReturnToDepots = false; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); diff --git a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/eshifts/run/RunEShiftDrtScenarioIT.java b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/eshifts/run/RunEShiftDrtScenarioIT.java index 2bd5fdffc27..6f4e8ceb392 100644 --- a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/eshifts/run/RunEShiftDrtScenarioIT.java +++ b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/eshifts/run/RunEShiftDrtScenarioIT.java @@ -13,6 +13,7 @@ import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams; import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams; import org.matsim.contrib.drt.run.DrtConfigGroup; +import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams; import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.dvrp.run.DvrpConfigGroup; import org.matsim.contrib.ev.EvConfigGroup; @@ -56,16 +57,17 @@ void test() { DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup; drtConfigGroup.mode = TransportMode.drt; - drtConfigGroup.maxTravelTimeAlpha = 1.5; - drtConfigGroup.maxTravelTimeBeta = 10. * 60.; + DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam(); + constraintsParam.maxTravelTimeAlpha = 1.5; + constraintsParam.maxTravelTimeBeta = 10. * 60.; drtConfigGroup.stopDuration = 30.; - drtConfigGroup.maxWaitTime = 600.; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = true; + constraintsParam.maxWaitTime = 600.; + constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true; drtConfigGroup.useModeFilteredSubnetwork = false; drtConfigGroup.vehiclesFile = fleetFile; drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door; drtConfigGroup.plotDetailedCustomerStats = true; - drtConfigGroup.maxWalkDistance = 1000.; + constraintsParam.maxWalkDistance = 1000.; drtConfigGroup.idleVehiclesReturnToDepots = false; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); diff --git a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunMultiHubShiftDrtScenarioIT.java b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunMultiHubShiftDrtScenarioIT.java index b0b5089b81e..49033927906 100644 --- a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunMultiHubShiftDrtScenarioIT.java +++ b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunMultiHubShiftDrtScenarioIT.java @@ -13,6 +13,7 @@ import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams; import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams; import org.matsim.contrib.drt.run.DrtConfigGroup; +import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams; import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.dvrp.run.DvrpConfigGroup; import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams; @@ -45,16 +46,17 @@ void test() { DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup; drtConfigGroup.mode = TransportMode.drt; - drtConfigGroup.maxTravelTimeAlpha = 1.5; - drtConfigGroup.maxTravelTimeBeta = 10. * 60.; + DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam(); + constraintsParam.maxTravelTimeAlpha = 1.5; + constraintsParam.maxTravelTimeBeta = 10. * 60.; drtConfigGroup.stopDuration = 30.; - drtConfigGroup.maxWaitTime = 600.; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = true; + constraintsParam.maxWaitTime = 600.; + constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true; drtConfigGroup.useModeFilteredSubnetwork = false; drtConfigGroup.vehiclesFile = fleetFile; drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door; drtConfigGroup.plotDetailedCustomerStats = true; - drtConfigGroup.maxWalkDistance = 1000.; + constraintsParam.maxWalkDistance = 1000.; drtConfigGroup.idleVehiclesReturnToDepots = false; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); diff --git a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunShiftDrtScenarioIT.java b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunShiftDrtScenarioIT.java index 1d85910ebec..f794e546c51 100644 --- a/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunShiftDrtScenarioIT.java +++ b/contribs/drt-extensions/src/test/java/org/matsim/contrib/drt/extension/operations/shifts/run/RunShiftDrtScenarioIT.java @@ -13,6 +13,7 @@ import org.matsim.contrib.drt.optimizer.rebalancing.RebalancingParams; import org.matsim.contrib.drt.optimizer.rebalancing.mincostflow.MinCostFlowRebalancingStrategyParams; import org.matsim.contrib.drt.run.DrtConfigGroup; +import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams; import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.dvrp.run.DvrpConfigGroup; import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams; @@ -46,16 +47,17 @@ void test() { DrtConfigGroup drtConfigGroup = drtWithShiftsConfigGroup; drtConfigGroup.mode = TransportMode.drt; - drtConfigGroup.maxTravelTimeAlpha = 1.5; - drtConfigGroup.maxTravelTimeBeta = 10. * 60.; + DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam(); + constraintsParam.maxTravelTimeAlpha = 1.5; + constraintsParam.maxTravelTimeBeta = 10. * 60.; drtConfigGroup.stopDuration = 30.; - drtConfigGroup.maxWaitTime = 600.; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = true; + constraintsParam.maxWaitTime = 600.; + constraintsParam.rejectRequestIfMaxWaitOrTravelTimeViolated = true; drtConfigGroup.useModeFilteredSubnetwork = false; drtConfigGroup.vehiclesFile = fleetFile; drtConfigGroup.operationalScheme = DrtConfigGroup.OperationalScheme.door2door; drtConfigGroup.plotDetailedCustomerStats = true; - drtConfigGroup.maxWalkDistance = 1000.; + constraintsParam.maxWalkDistance = 1000.; drtConfigGroup.idleVehiclesReturnToDepots = false; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/analysis/DrtAnalysisControlerListener.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/analysis/DrtAnalysisControlerListener.java index edc20fb87b7..3cc19b7a938 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/analysis/DrtAnalysisControlerListener.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/analysis/DrtAnalysisControlerListener.java @@ -400,7 +400,7 @@ private void writeAndPlotWaitTimeEstimateComparison(Collection pe if (createChart) { final JFreeChart chart2 = DensityScatterPlots.createPlot("Wait times", "Actual wait time [s]", "Initially planned wait time [s]", - times, Pair.of(0., drtCfg.maxWaitTime)); + times, Pair.of(0., drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime)); // xAxis.setLowerBound(0); // yAxis.setLowerBound(0); ChartUtils.writeChartAsPNG(new FileOutputStream(plotFileName), chart2, 1500, 1500); @@ -664,11 +664,11 @@ private static void analyseDetours(Network network, List legs, Map new DefaultOfferAcceptor(drtCfg.maxAllowedPickupDelay))); + bindModal(DefaultOfferAcceptor.class).toProvider(modalProvider(getter -> new DefaultOfferAcceptor(drtCfg.getDrtOptimizationConstraintsParam().maxAllowedPickupDelay))); bindModal(DrtOfferAcceptor.class).to(modalKey(DefaultOfferAcceptor.class)); bindModal(ScheduleTimingUpdater.class).toProvider(modalProvider( diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRouteCreator.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRouteCreator.java index 15f9bb77530..c19a631ac44 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRouteCreator.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRouteCreator.java @@ -61,7 +61,7 @@ public DrtRouteCreator(DrtConfigGroup drtCfg, Network modalNetwork, * @return maximum travel time */ static double getMaxTravelTime(DrtConfigGroup drtCfg, double unsharedRideTime) { - return drtCfg.maxTravelTimeAlpha * unsharedRideTime + drtCfg.maxTravelTimeBeta; + return drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha * unsharedRideTime + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta; } /** @@ -72,7 +72,7 @@ static double getMaxTravelTime(DrtConfigGroup drtCfg, double unsharedRideTime) { * @return maximum ride time */ static double getMaxRideTime(DrtConfigGroup drtCfg, double unsharedRideTime) { - return Math.min(unsharedRideTime + drtCfg.maxAbsoluteDetour, drtCfg.maxDetourAlpha * unsharedRideTime + drtCfg.maxDetourBeta); + return Math.min(unsharedRideTime + drtCfg.getDrtOptimizationConstraintsParam().maxAbsoluteDetour, drtCfg.getDrtOptimizationConstraintsParam().maxDetourAlpha * unsharedRideTime + drtCfg.getDrtOptimizationConstraintsParam().maxDetourBeta); } public Route createRoute(double departureTime, Link accessActLink, Link egressActLink, Person person, @@ -89,7 +89,7 @@ public Route createRoute(double departureTime, Link accessActLink, Link egressAc route.setTravelTime(maxTravelTime); route.setMaxRideTime(maxRideDuration); route.setDirectRideTime(unsharedRideTime); - route.setMaxWaitTime(drtCfg.maxWaitTime); + route.setMaxWaitTime(drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime); if (this.drtCfg.storeUnsharedPath) { route.setUnsharedPath(unsharedPath); 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 2e1923688c6..687b48b16fc 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 @@ -19,17 +19,15 @@ package org.matsim.contrib.drt.run; -import static org.matsim.core.config.groups.QSimConfigGroup.EndtimeInterpretation; - -import java.util.Collection; -import java.util.Optional; - -import javax.annotation.Nullable; - +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.checkerframework.checker.units.qual.C; import org.matsim.api.core.v01.TransportMode; +import org.matsim.contrib.common.util.ReflectiveConfigGroupWithConfigurableParameterSets; import org.matsim.contrib.drt.analysis.zonal.DrtZoneSystemParams; import org.matsim.contrib.drt.estimator.DrtEstimatorParams; import org.matsim.contrib.drt.fare.DrtFareParams; @@ -44,19 +42,15 @@ import org.matsim.contrib.drt.speedup.DrtSpeedUpParams; import org.matsim.contrib.dvrp.router.DvrpModeRoutingNetworkModule; import org.matsim.contrib.dvrp.run.Modal; -import org.matsim.contrib.common.util.ReflectiveConfigGroupWithConfigurableParameterSets; import org.matsim.core.config.Config; -import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.config.groups.RoutingConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; -import com.google.common.base.Preconditions; -import com.google.common.base.Verify; +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Optional; -import jakarta.validation.constraints.DecimalMin; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Positive; -import jakarta.validation.constraints.PositiveOrZero; +import static org.matsim.core.config.groups.QSimConfigGroup.EndtimeInterpretation; public class DrtConfigGroup extends ReflectiveConfigGroupWithConfigurableParameterSets implements Modal { private static final Logger log = LogManager.getLogger(DrtConfigGroup.class); @@ -70,6 +64,9 @@ public static DrtConfigGroup getSingleModeDrtConfig(Config config) { return drtConfigGroups.iterator().next(); } + @NotNull + private DrtOptimizationConstraintsParams drtOptimizationConstraintsParams; + @Parameter @Comment("Mode which will be handled by PassengerEngine and VrpOptimizer (passengers'/customers' perspective)") @NotBlank @@ -88,66 +85,6 @@ public static DrtConfigGroup getSingleModeDrtConfig(Config config) { @Positive public double stopDuration = Double.NaN;// seconds - @Parameter - @Comment("Max wait time for the bus to come (optimisation constraint).") - @PositiveOrZero - public double maxWaitTime = Double.NaN;// seconds - - @Parameter - @Comment("Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. " - + "min(unsharedRideTime + maxAbsoluteDetour, maxTravelTimeAlpha * unsharedRideTime + maxTravelTimeBeta). " - + "Alpha should not be smaller than 1.") - @DecimalMin("1.0") - public double maxTravelTimeAlpha = Double.NaN;// [-] - - @Parameter - @Comment("Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. " - + "min(unsharedRideTime + maxAbsoluteDetour, maxTravelTimeAlpha * unsharedRideTime + maxTravelTimeBeta). " - + "Beta should not be smaller than 0.") - @PositiveOrZero - public double maxTravelTimeBeta = Double.NaN;// [s] - - @Parameter - @Comment( - "Defines the maximum allowed absolute detour in seconds. Note that the detour is computed from the latest promised pickup time. " + - "To enable the max detour constraint, maxAllowedPickupDelay has to be specified. maxAbsoluteDetour should not be smaller than 0, " - + "and should be higher than the offset maxDetourBeta. By default, this limit is disabled (i.e. set to Inf)") - @PositiveOrZero - public double maxAbsoluteDetour = Double.POSITIVE_INFINITY;// [s] - - @Parameter - @Comment( - "Defines the maximum allowed absolute detour based on the unsharedRideTime. Note that the detour is computed from the latest promised " - + "pickup time. To enable the max detour constraint, maxAllowedPickupDelay has to be specified. A linear combination similar to travel " - + "time constrain is used. This is the ratio part. By default, this limit is disabled (i.e. set to Inf, together with maxDetourBeta).") - @DecimalMin("1.0") - public double maxDetourAlpha = Double.POSITIVE_INFINITY; - - @Parameter - @Comment( - "Defines the maximum allowed absolute detour based on the unsharedRideTime. Note that the detour is computed from the latest promised " - + "pickup time. To enable the max detour constraint, maxAllowedPickupDelay has to be specified. A linear combination similar to travel " - + "time constrain is used. This is the constant part. By default, this limit is disabled (i.e. set to Inf, together with maxDetourAlpha).") - @PositiveOrZero - public double maxDetourBeta = Double.POSITIVE_INFINITY;// [s] - - @Parameter - @Comment( - "Defines the maximum delay allowed from the initial scheduled pick up time. Once the initial pickup time is offered, the latest promised" - + "pickup time is calculated based on initial scheduled pickup time + maxAllowedPickupDelay. " - + "By default, this limit is disabled. If enabled, a value between 0 and 240 is a good choice.") - @PositiveOrZero - public double maxAllowedPickupDelay = Double.POSITIVE_INFINITY;// [s] - - @Parameter - @Comment("If true, the max travel and wait times of a submitted request" - + " are considered hard constraints (the request gets rejected if one of the constraints is violated)." - + " If false, the max travel and wait times are considered soft constraints (insertion of a request that" - + " violates one of the constraints is allowed, but its cost is increased by additional penalty to make" - + " it relatively less attractive). Penalisation of insertions can be customised by injecting a customised" - + " InsertionCostCalculator.PenaltyCalculator") - public boolean rejectRequestIfMaxWaitOrTravelTimeViolated = true; - @Parameter @Comment("If true, the startLink is changed to last link in the current schedule, so the taxi starts the next " + "day at the link where it stopped operating the day before. False by default.") @@ -175,14 +112,6 @@ public enum OperationalScheme { @NotNull public OperationalScheme operationalScheme = OperationalScheme.door2door; - //TODO consider renaming maxWalkDistance to max access/egress distance (or even have 2 separate params) - @Parameter - @Comment( - "Maximum beeline distance (in meters) to next stop location in stopbased system for access/egress walk leg to/from drt." - + " If no stop can be found within this maximum distance will return null (in most cases caught by fallback routing module).") - @PositiveOrZero // used only for stopbased DRT scheme - public double maxWalkDistance = Double.MAX_VALUE;// [m]; - @Parameter @Comment("An XML file specifying the vehicle fleet." + " The file format according to dvrp_vehicles_v1.dtd" @@ -257,6 +186,10 @@ public DrtConfigGroup() { } private void initSingletonParameterSets() { + //drt optimization constraints + addDefinition(DrtOptimizationConstraintsParams.SET_NAME, DrtOptimizationConstraintsParams::new, + () -> drtOptimizationConstraintsParams, params -> drtOptimizationConstraintsParams = (DrtOptimizationConstraintsParams) params); + //rebalancing (optional) addDefinition(RebalancingParams.SET_NAME, RebalancingParams::new, () -> rebalancingParams, params -> rebalancingParams = (RebalancingParams)params); @@ -301,6 +234,27 @@ private void initSingletonParameterSets() { } + /** + * for backwards compatibility with old drt config groups + */ + public void handleAddUnknownParam(final String paramName, final String value) { + switch (paramName) { + case "maxWaitTime": + case "maxTravelTimeAlpha": + case "maxTravelTimeBeta": + case "maxAbsoluteDetour": + case "maxDetourAlpha": + case "maxDetourBeta": + case "maxAllowedPickupDelay": + case "rejectRequestIfMaxWaitOrTravelTimeViolated": + case "maxWalkDistance": + getDrtOptimizationConstraintsParam().addParam(paramName, value); + break; + default: + super.handleAddUnknownParam(paramName, value); + } + } + @Override protected void checkConsistency(Config config) { super.checkConsistency(config); @@ -315,7 +269,7 @@ protected void checkConsistency(Config config) { + "attempting to travel without vehicles being available."); } - Verify.verify(maxWaitTime >= stopDuration, "maxWaitTime must not be smaller than stopDuration"); + Verify.verify(drtOptimizationConstraintsParams.maxWaitTime >= stopDuration, "maxWaitTime must not be smaller than stopDuration"); Verify.verify(operationalScheme != OperationalScheme.stopbased || transitStopFile != null, "transitStopFile must not be null when operationalScheme is " + OperationalScheme.stopbased); @@ -344,11 +298,6 @@ protected void checkConsistency(Config config) { DvrpModeRoutingNetworkModule.checkUseModeFilteredSubnetworkAllowed(config, mode); } - if ((maxDetourAlpha != Double.POSITIVE_INFINITY && maxDetourBeta != Double.POSITIVE_INFINITY) || maxAbsoluteDetour != Double.POSITIVE_INFINITY) { - Verify.verify(maxAllowedPickupDelay != Double.POSITIVE_INFINITY, "Detour constraints are activated, " + - "maxAllowedPickupDelay must be specified! A value between 0 and 240 seconds can be a good choice for maxAllowedPickupDelay."); - } - if (simulationType == SimulationType.estimateAndTeleport) { Verify.verify(drtSpeedUpParams == null, "Simulation type is estimateAndTeleport, but drtSpeedUpParams is set. " + "Please remove drtSpeedUpParams from the config, as these two functionalities are not compatible."); @@ -360,6 +309,13 @@ public String getMode() { return mode; } + public DrtOptimizationConstraintsParams getDrtOptimizationConstraintsParam() { + if (drtOptimizationConstraintsParams == null) { + addParameterSet(new DrtOptimizationConstraintsParams()); + } + return drtOptimizationConstraintsParams; + } + public DrtInsertionSearchParams getDrtInsertionSearchParams() { return drtInsertionSearchParams; } diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtModeRoutingModule.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtModeRoutingModule.java index 8d037b171dc..af5916d028a 100644 --- a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtModeRoutingModule.java +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtModeRoutingModule.java @@ -104,7 +104,7 @@ public void install() { .asEagerSingleton(); case stopbased, serviceAreaBased -> { bindModal( AccessEgressFacilityFinder.class ).toProvider( modalProvider( - getter -> new ClosestAccessEgressFacilityFinder( drtCfg.maxWalkDistance, + getter -> new ClosestAccessEgressFacilityFinder( drtCfg.getDrtOptimizationConstraintsParam().maxWalkDistance, getter.get( Network.class ), QuadTrees.createQuadTree( getter.getModal( DrtStopNetwork.class ).getDrtStops().values() ) ) ) ) .asEagerSingleton(); diff --git a/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtOptimizationConstraintsParams.java b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtOptimizationConstraintsParams.java new file mode 100644 index 00000000000..f3f1e1ed5f2 --- /dev/null +++ b/contribs/drt/src/main/java/org/matsim/contrib/drt/run/DrtOptimizationConstraintsParams.java @@ -0,0 +1,96 @@ +package org.matsim.contrib.drt.run; + +import com.google.common.base.Verify; +import jakarta.validation.constraints.DecimalMin; +import jakarta.validation.constraints.PositiveOrZero; +import org.matsim.core.config.Config; +import org.matsim.core.config.ReflectiveConfigGroup; + +/** + * @author nkuehnel / MOIA + */ +public class DrtOptimizationConstraintsParams extends ReflectiveConfigGroup { + + public final static String SET_NAME = "drtOptimizationConstraints"; + + + @Parameter + @Comment("Max wait time for the bus to come (optimisation constraint).") + @PositiveOrZero + public double maxWaitTime = Double.NaN;// seconds + + @Parameter + @Comment("Defines the slope of the maxTravelTime estimation function (optimisation constraint), i.e. " + + "min(unsharedRideTime + maxAbsoluteDetour, maxTravelTimeAlpha * unsharedRideTime + maxTravelTimeBeta). " + + "Alpha should not be smaller than 1.") + @DecimalMin("1.0") + public double maxTravelTimeAlpha = Double.NaN;// [-] + + @Parameter + @Comment("Defines the shift of the maxTravelTime estimation function (optimisation constraint), i.e. " + + "min(unsharedRideTime + maxAbsoluteDetour, maxTravelTimeAlpha * unsharedRideTime + maxTravelTimeBeta). " + + "Beta should not be smaller than 0.") + @PositiveOrZero + public double maxTravelTimeBeta = Double.NaN;// [s] + + @Parameter + @Comment( + "Defines the maximum allowed absolute detour in seconds. Note that the detour is computed from the latest promised pickup time. " + + "To enable the max detour constraint, maxAllowedPickupDelay has to be specified. maxAbsoluteDetour should not be smaller than 0, " + + "and should be higher than the offset maxDetourBeta. By default, this limit is disabled (i.e. set to Inf)") + @PositiveOrZero + public double maxAbsoluteDetour = Double.POSITIVE_INFINITY;// [s] + + @Parameter + @Comment( + "Defines the maximum allowed absolute detour based on the unsharedRideTime. Note that the detour is computed from the latest promised " + + "pickup time. To enable the max detour constraint, maxAllowedPickupDelay has to be specified. A linear combination similar to travel " + + "time constrain is used. This is the ratio part. By default, this limit is disabled (i.e. set to Inf, together with maxDetourBeta).") + @DecimalMin("1.0") + public double maxDetourAlpha = Double.POSITIVE_INFINITY; + + @Parameter + @Comment( + "Defines the maximum allowed absolute detour based on the unsharedRideTime. Note that the detour is computed from the latest promised " + + "pickup time. To enable the max detour constraint, maxAllowedPickupDelay has to be specified. A linear combination similar to travel " + + "time constrain is used. This is the constant part. By default, this limit is disabled (i.e. set to Inf, together with maxDetourAlpha).") + @PositiveOrZero + public double maxDetourBeta = Double.POSITIVE_INFINITY;// [s] + + @Parameter + @Comment( + "Defines the maximum delay allowed from the initial scheduled pick up time. Once the initial pickup time is offered, the latest promised" + + "pickup time is calculated based on initial scheduled pickup time + maxAllowedPickupDelay. " + + "By default, this limit is disabled. If enabled, a value between 0 and 240 is a good choice.") + @PositiveOrZero + public double maxAllowedPickupDelay = Double.POSITIVE_INFINITY;// [s] + + @Parameter + @Comment("If true, the max travel and wait times of a submitted request" + + " are considered hard constraints (the request gets rejected if one of the constraints is violated)." + + " If false, the max travel and wait times are considered soft constraints (insertion of a request that" + + " violates one of the constraints is allowed, but its cost is increased by additional penalty to make" + + " it relatively less attractive). Penalisation of insertions can be customised by injecting a customised" + + " InsertionCostCalculator.PenaltyCalculator") + public boolean rejectRequestIfMaxWaitOrTravelTimeViolated = true;//TODO consider renaming maxWalkDistance to max access/egress distance (or even have 2 separate params) + + @Parameter + @Comment( + "Maximum beeline distance (in meters) to next stop location in stopbased system for access/egress walk leg to/from drt." + + " If no stop can be found within this maximum distance will return null (in most cases caught by fallback routing module).") + @PositiveOrZero // used only for stopbased DRT scheme + public double maxWalkDistance = Double.MAX_VALUE;// [m]; + + public DrtOptimizationConstraintsParams() { + super(SET_NAME); + } + + @Override + protected void checkConsistency(Config config) { + super.checkConsistency(config); + if ((maxDetourAlpha != Double.POSITIVE_INFINITY && maxDetourBeta != Double.POSITIVE_INFINITY) || maxAbsoluteDetour != Double.POSITIVE_INFINITY) { + Verify.verify(maxAllowedPickupDelay != Double.POSITIVE_INFINITY, "Detour constraints are activated, " + + "maxAllowedPickupDelay must be specified! A value between 0 and 240 seconds can be a good choice for maxAllowedPickupDelay."); + } + } +} \ No newline at end of file diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/MaxDetourConstraintTest.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/MaxDetourConstraintTest.java index ec0e2a1f030..8722cc9e657 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/MaxDetourConstraintTest.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/MaxDetourConstraintTest.java @@ -36,17 +36,17 @@ public void testMaxDetourConstraint() { DrtConfigGroup drtConfigGroup = DrtConfigGroup.getSingleModeDrtConfig(config); // Max wait time - drtConfigGroup.maxWaitTime = 300; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = 300; // Turn on the max detour constraint - drtConfigGroup.maxDetourAlpha = 1.5; - drtConfigGroup.maxDetourBeta = 300; - drtConfigGroup.maxAllowedPickupDelay = 180; - drtConfigGroup.maxAbsoluteDetour = 1200; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxDetourAlpha = 1.5; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxDetourBeta = 300; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxAllowedPickupDelay = 180; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxAbsoluteDetour = 1200; // Make the max total travel time constraints very loose (i.e., make it not active) - drtConfigGroup.maxTravelTimeAlpha = 10; - drtConfigGroup.maxTravelTimeBeta = 7200; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 10; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 7200; config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/insertion/DrtPoolingParameterTest.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/insertion/DrtPoolingParameterTest.java index 8451f93b1e2..dfff04e67da 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/insertion/DrtPoolingParameterTest.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/optimizer/insertion/DrtPoolingParameterTest.java @@ -225,9 +225,9 @@ private PersonEnterDrtVehicleEventHandler setupAndRunScenario(double maxWaitTime MultiModeDrtConfigGroup mm = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class); mm.getModalElements().forEach(x -> { - x.maxWaitTime = maxWaitTime; - x.maxTravelTimeAlpha = maxTravelTimeAlpha; - x.maxTravelTimeBeta = maxTravelTimeBeta; + x.getDrtOptimizationConstraintsParam().maxWaitTime = maxWaitTime; + x.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = maxTravelTimeAlpha; + x.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = maxTravelTimeBeta; x.stopDuration = 1.; }); diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/ComplexUnschedulerTest.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/ComplexUnschedulerTest.java index 93a59a769bd..9f6b424da09 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/ComplexUnschedulerTest.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/ComplexUnschedulerTest.java @@ -626,7 +626,7 @@ private class Fixture { DrtConfigGroup drtConfig = new DrtConfigGroup(); drtConfig.stopDuration = 30.0; - drtConfig.maxWaitTime = 600.0; + drtConfig.getDrtOptimizationConstraintsParam().maxWaitTime = 600.0; this.entryFactory = new VehicleDataEntryFactoryImpl(); diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/PrebookingTestEnvironment.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/PrebookingTestEnvironment.java index c97f2c34a81..e4cece58765 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/PrebookingTestEnvironment.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/prebooking/PrebookingTestEnvironment.java @@ -226,9 +226,9 @@ private void buildConfig(Config config) { DrtConfigGroup modeConfig = new DrtConfigGroup(); drtConfig.addParameterSet(modeConfig); modeConfig.mode = "drt"; - modeConfig.maxWaitTime = maximumWaitTime; - modeConfig.maxTravelTimeAlpha = detourRelative; - modeConfig.maxTravelTimeBeta = detourAbsolute; + modeConfig.getDrtOptimizationConstraintsParam().maxWaitTime = maximumWaitTime; + modeConfig.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = detourRelative; + modeConfig.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = detourAbsolute; modeConfig.stopDuration = stopDuration; modeConfig.idleVehiclesReturnToDepots = false; modeConfig.vehiclesFile = null; diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/routing/DrtRoutingModuleTest.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/routing/DrtRoutingModuleTest.java index e4d242dabcf..f86bbeb7215 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/routing/DrtRoutingModuleTest.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/routing/DrtRoutingModuleTest.java @@ -80,9 +80,9 @@ void testCottbusClosestAccessEgressStopFinder() { DrtConfigGroup drtCfg = DrtConfigGroup.getSingleModeDrtConfig(scenario.getConfig()); String drtMode = "DrtX"; drtCfg.mode = drtMode; - drtCfg.maxTravelTimeAlpha = 1.5; - drtCfg.maxTravelTimeBeta = 5 * 60; - drtCfg.maxWaitTime = 5 * 60; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.5; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 5 * 60; + drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime = 5 * 60; ImmutableMap, DrtStopFacility> drtStops = scenario.getTransitSchedule() .getFacilities() @@ -91,7 +91,7 @@ void testCottbusClosestAccessEgressStopFinder() { .map(DrtStopFacilityImpl::createFromFacility) .collect(ImmutableMap.toImmutableMap(DrtStopFacility::getId, f -> f)); - AccessEgressFacilityFinder stopFinder = new ClosestAccessEgressFacilityFinder(drtCfg.maxWalkDistance, + AccessEgressFacilityFinder stopFinder = new ClosestAccessEgressFacilityFinder(drtCfg.getDrtOptimizationConstraintsParam().maxWalkDistance, scenario.getNetwork(), QuadTrees.createQuadTree(drtStops.values())); DrtRouteCreator drtRouteCreator = new DrtRouteCreator(drtCfg, scenario.getNetwork(), new SpeedyDijkstraFactory(), new FreeSpeedTravelTime(), TimeAsTravelDisutility::new); @@ -259,7 +259,7 @@ void testRouteDescriptionHandling() { private Scenario createTestScenario() { Config config = ConfigUtils.createConfig(); DrtConfigGroup drtConfigGroup = new DrtConfigGroup(); - drtConfigGroup.maxWalkDistance = 200; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWalkDistance = 200; drtConfigGroup.transitStopFile = utils.getClassInputDirectory() + "testCottbus/drtstops.xml.gz"; MultiModeDrtConfigGroup multiModeDrtConfigGroup = new MultiModeDrtConfigGroup(); multiModeDrtConfigGroup.addParameterSet(drtConfigGroup); diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunDrtExampleIT.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunDrtExampleIT.java index e1c1492fbed..6b15ba1bc9e 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunDrtExampleIT.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunDrtExampleIT.java @@ -90,7 +90,7 @@ void testRunDrtExampleWithNoRejections_ExtensiveSearch() { for (var drtCfg : MultiModeDrtConfigGroup.get(config).getModalElements()) { //disable rejections - drtCfg.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; } config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); @@ -129,7 +129,7 @@ void testRunDrtExampleWithNoRejections_SelectiveSearch() { drtCfg.addParameterSet(selectiveInsertionSearchParams); //disable rejections - drtCfg.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; } config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); @@ -168,7 +168,7 @@ void testRunDrtExampleWithNoRejections_RepeatedSelectiveSearch() { drtCfg.addParameterSet(repeatedSelectiveInsertionSearchParams); //disable rejections - drtCfg.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; } config.controller().setLastIteration(3); @@ -393,7 +393,7 @@ void testRunDrtWithPrebooking() { * rejectionRate, rejections, waitAverage, inVehicleTravelTimeMean, & totalTravelTimeMean */ - private void verifyDrtCustomerStatsCloseToExpectedStats(String outputDirectory, Stats expectedStats) { + static void verifyDrtCustomerStatsCloseToExpectedStats(String outputDirectory, Stats expectedStats) { String filename = outputDirectory + "/drt_customer_stats_drt.csv"; @@ -424,7 +424,7 @@ private void verifyDrtCustomerStatsCloseToExpectedStats(String outputDirectory, assertThat(actualStats).usingRecursiveComparison().isEqualTo(expectedStats); } - private static class Stats { + static class Stats { private final double rejectionRate; private final double rejections; private final double waitAverage; diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunOldDrtConfigCompatibilityIT.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunOldDrtConfigCompatibilityIT.java new file mode 100644 index 00000000000..506bb7503c2 --- /dev/null +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/run/examples/RunOldDrtConfigCompatibilityIT.java @@ -0,0 +1,61 @@ +package org.matsim.contrib.drt.run.examples; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.matsim.api.core.v01.Id; +import org.matsim.contrib.common.zones.systems.grid.square.SquareGridZoneSystemParams; +import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; +import org.matsim.contrib.dvrp.run.DvrpConfigGroup; +import org.matsim.contrib.zone.skims.DvrpTravelTimeMatrixParams; +import org.matsim.core.config.Config; +import org.matsim.core.config.ConfigUtils; +import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.utils.io.IOUtils; +import org.matsim.examples.ExamplesUtils; +import org.matsim.testcases.MatsimTestUtils; +import org.matsim.vis.otfvis.OTFVisConfigGroup; + +import java.net.URL; + +/** + * + * Tests the older drt config version where optimization constraints where not stored as separate parameters + * @author nkuehnel / MOIA + */ +public class RunOldDrtConfigCompatibilityIT { + + @RegisterExtension + private MatsimTestUtils utils = new MatsimTestUtils(); + + @Test + void testRunDrtExampleWithNoRejections_ExtensiveSearch() { + Id.resetCaches(); + + DvrpConfigGroup dvrpConfigGroup = new DvrpConfigGroup(); + DvrpTravelTimeMatrixParams matrixParams = dvrpConfigGroup.getTravelTimeMatrixParams(); + matrixParams.addParameterSet(matrixParams.createParameterSet(SquareGridZoneSystemParams.SET_NAME)); + + URL configUrl = IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("mielec"), "mielec_drt_config_v1.xml"); + Config config = ConfigUtils.loadConfig(configUrl, new MultiModeDrtConfigGroup(), dvrpConfigGroup, + new OTFVisConfigGroup()); + + for (var drtCfg : MultiModeDrtConfigGroup.get(config).getModalElements()) { + //disable rejections + drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; + } + + config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOutputDirectory(utils.getOutputDirectory()); + RunDrtExample.run(config, false); + + var expectedStats = RunDrtExampleIT.Stats.newBuilder() + .rejectionRate(0.0) + .rejections(0) + .waitAverage(297.19) + .inVehicleTravelTimeMean(386.78) + .totalTravelTimeMean(683.97) + .build(); + + RunDrtExampleIT.verifyDrtCustomerStatsCloseToExpectedStats(utils.getOutputDirectory(), expectedStats); + } +} diff --git a/contribs/drt/src/test/java/org/matsim/contrib/drt/teleportation/DrtTeleportationTest.java b/contribs/drt/src/test/java/org/matsim/contrib/drt/teleportation/DrtTeleportationTest.java index 4cd79608057..27dfd190989 100644 --- a/contribs/drt/src/test/java/org/matsim/contrib/drt/teleportation/DrtTeleportationTest.java +++ b/contribs/drt/src/test/java/org/matsim/contrib/drt/teleportation/DrtTeleportationTest.java @@ -12,6 +12,7 @@ import org.matsim.contrib.drt.fare.DrtFareParams; import org.matsim.contrib.drt.run.DrtConfigGroup; import org.matsim.contrib.drt.run.DrtControlerCreator; +import org.matsim.contrib.drt.run.DrtOptimizationConstraintsParams; import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; import org.matsim.contrib.dvrp.run.DvrpConfigGroup; import org.matsim.core.config.Config; @@ -45,9 +46,10 @@ void testTeleportationEngine() throws IOException { Controler controler = DrtControlerCreator.createControler(config, false); DrtConfigGroup drtConfigGroup = DrtConfigGroup.getSingleModeDrtConfig(config); - drtConfigGroup.maxTravelTimeAlpha = 1.2; - drtConfigGroup.maxTravelTimeBeta = 600; - drtConfigGroup.maxWaitTime = 300; + DrtOptimizationConstraintsParams constraintsParam = drtConfigGroup.getDrtOptimizationConstraintsParam(); + constraintsParam.maxTravelTimeAlpha = 1.2; + constraintsParam.maxTravelTimeBeta = 600; + constraintsParam.maxWaitTime = 300; DrtFareParams fareParams = new DrtFareParams(); fareParams.baseFare = 1.0; fareParams.distanceFare_m = 0.001; @@ -75,12 +77,12 @@ public void install() { double waitAvg = Double.parseDouble(row.get("wait_average")); - assertThat(waitAvg).isEqualTo(drtConfigGroup.maxWaitTime); + assertThat(waitAvg).isEqualTo(constraintsParam.maxWaitTime); double distMean = Double.parseDouble(row.get("distance_m_mean")); double directDistMean = Double.parseDouble(row.get("directDistance_m_mean")); - assertThat(distMean / directDistMean).isCloseTo(drtConfigGroup.maxTravelTimeAlpha, Offset.offset(0.0001)); + assertThat(distMean / directDistMean).isCloseTo(constraintsParam.maxTravelTimeAlpha, Offset.offset(0.0001)); } diff --git a/contribs/taxi/src/main/java/org/matsim/contrib/taxi/run/MultiModeTaxiModule.java b/contribs/taxi/src/main/java/org/matsim/contrib/taxi/run/MultiModeTaxiModule.java index 31bf3440150..b4aa67762e0 100644 --- a/contribs/taxi/src/main/java/org/matsim/contrib/taxi/run/MultiModeTaxiModule.java +++ b/contribs/taxi/src/main/java/org/matsim/contrib/taxi/run/MultiModeTaxiModule.java @@ -66,16 +66,16 @@ public static DrtConfigGroup convertTaxiToDrtCfg(TaxiConfigGroup taxiCfg) { // Taxi optimisers do not reject, so time constraints are only used for routing plans (DrtRouteCreator). // Using some (relatively high) values as we do not know what values should be there. They can be adjusted // manually after the TaxiAsDrtConfigGroup config is created. - drtCfg.maxWaitTime = 3600; - drtCfg.maxTravelTimeAlpha = 2; - drtCfg.maxTravelTimeBeta = 3600; - drtCfg.maxAbsoluteDetour = Double.MAX_VALUE; + drtCfg.getDrtOptimizationConstraintsParam().maxWaitTime = 3600; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 2; + drtCfg.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 3600; + drtCfg.getDrtOptimizationConstraintsParam().maxAbsoluteDetour = Double.MAX_VALUE; - drtCfg.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtCfg.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtCfg.changeStartLinkToLastLinkInSchedule = taxiCfg.changeStartLinkToLastLinkInSchedule; drtCfg.idleVehiclesReturnToDepots = false; drtCfg.operationalScheme = DrtConfigGroup.OperationalScheme.door2door; - drtCfg.maxWalkDistance = Double.MAX_VALUE; + drtCfg.getDrtOptimizationConstraintsParam().maxWalkDistance = Double.MAX_VALUE; drtCfg.vehiclesFile = taxiCfg.taxisFile; drtCfg.transitStopFile = null; drtCfg.drtServiceAreaShapeFile = null; diff --git a/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALine2Test.java b/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALine2Test.java index 3e00dd03d50..f99512782ef 100644 --- a/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALine2Test.java +++ b/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALine2Test.java @@ -229,11 +229,11 @@ void testPtAlongALineWithRaptorAndDrtServiceArea() { { DrtConfigGroup drtConfigGroup = new DrtConfigGroup(); drtConfigGroup.mode = TransportMode.drt; - drtConfigGroup.maxTravelTimeAlpha = 2.0; - drtConfigGroup.maxTravelTimeBeta = 5. * 60.; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 2.0; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 5. * 60.; drtConfigGroup.stopDuration = 60.; - drtConfigGroup.maxWaitTime = Double.MAX_VALUE; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = Double.MAX_VALUE; + drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtConfigGroup.useModeFilteredSubnetwork = true; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); @@ -243,11 +243,11 @@ void testPtAlongALineWithRaptorAndDrtServiceArea() { if (drt2) { DrtConfigGroup drtConfigGroup = new DrtConfigGroup(); drtConfigGroup.mode = "drt2"; - drtConfigGroup.maxTravelTimeAlpha = 1.3; - drtConfigGroup.maxTravelTimeBeta = 5. * 60.; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.3; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 5. * 60.; drtConfigGroup.stopDuration = 60.; - drtConfigGroup.maxWaitTime = Double.MAX_VALUE; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = Double.MAX_VALUE; + drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtConfigGroup.useModeFilteredSubnetwork = true; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); @@ -256,11 +256,11 @@ void testPtAlongALineWithRaptorAndDrtServiceArea() { if (drt3) { DrtConfigGroup drtConfigGroup = new DrtConfigGroup(); drtConfigGroup.mode = "drt3"; - drtConfigGroup.maxTravelTimeAlpha = 1.3; - drtConfigGroup.maxTravelTimeBeta = 5. * 60.; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.3; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 5. * 60.; drtConfigGroup.stopDuration = 60.; - drtConfigGroup.maxWaitTime = Double.MAX_VALUE; - drtConfigGroup.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtConfigGroup.getDrtOptimizationConstraintsParam().maxWaitTime = Double.MAX_VALUE; + drtConfigGroup.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtConfigGroup.useModeFilteredSubnetwork = true; drtConfigGroup.addParameterSet(new ExtensiveInsertionSearchParams()); diff --git a/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALineTest.java b/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALineTest.java index 00c908721c0..fd92aafff84 100644 --- a/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALineTest.java +++ b/contribs/vsp/src/test/java/org/matsim/integration/drtAndPt/PtAlongALineTest.java @@ -110,10 +110,10 @@ void testDrtAlongALine() { DrtConfigGroup drtConfig = new DrtConfigGroup(); drtConfig.mode = "drt_A"; drtConfig.stopDuration = 60.; - drtConfig.maxWaitTime = 900.; - drtConfig.maxTravelTimeAlpha = 1.3; - drtConfig.maxTravelTimeBeta = 10. * 60.; - drtConfig.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtConfig.getDrtOptimizationConstraintsParam().maxWaitTime = 900.; + drtConfig.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.3; + drtConfig.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 10. * 60.; + drtConfig.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtConfig.changeStartLinkToLastLinkInSchedule = true; multiModeDrtCfg.addParameterSet(drtConfig); } @@ -247,11 +247,11 @@ void testPtAlongALineWithRaptorAndDrtStopFilterAttribute() { MultiModeDrtConfigGroup mm = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class); { DrtConfigGroup drtConfig = new DrtConfigGroup(); - drtConfig.maxTravelTimeAlpha = 1.3; - drtConfig.maxTravelTimeBeta = 5. * 60.; + drtConfig.getDrtOptimizationConstraintsParam().maxTravelTimeAlpha = 1.3; + drtConfig.getDrtOptimizationConstraintsParam().maxTravelTimeBeta = 5. * 60.; drtConfig.stopDuration = 60.; - drtConfig.maxWaitTime = Double.MAX_VALUE; - drtConfig.rejectRequestIfMaxWaitOrTravelTimeViolated = false; + drtConfig.getDrtOptimizationConstraintsParam().maxWaitTime = Double.MAX_VALUE; + drtConfig.getDrtOptimizationConstraintsParam().rejectRequestIfMaxWaitOrTravelTimeViolated = false; drtConfig.mode = TransportMode.drt; mm.addParameterSet(drtConfig); } diff --git a/examples/scenarios/dvrp-grid/eight_shared_taxi_config.xml b/examples/scenarios/dvrp-grid/eight_shared_taxi_config.xml index fa26707492f..4dd451ddac4 100644 --- a/examples/scenarios/dvrp-grid/eight_shared_taxi_config.xml +++ b/examples/scenarios/dvrp-grid/eight_shared_taxi_config.xml @@ -5,10 +5,12 @@ - - - - + + + + + + diff --git a/examples/scenarios/dvrp-grid/multi_mode_one_shared_taxi_config.xml b/examples/scenarios/dvrp-grid/multi_mode_one_shared_taxi_config.xml index bb0c4beed1f..1d306865741 100644 --- a/examples/scenarios/dvrp-grid/multi_mode_one_shared_taxi_config.xml +++ b/examples/scenarios/dvrp-grid/multi_mode_one_shared_taxi_config.xml @@ -14,10 +14,12 @@ - - - - + + + + + + @@ -30,10 +32,12 @@ - - - - + + + + + + diff --git a/examples/scenarios/dvrp-grid/one_shared_taxi_config.xml b/examples/scenarios/dvrp-grid/one_shared_taxi_config.xml index 6f727d250e8..2d3b062aea6 100644 --- a/examples/scenarios/dvrp-grid/one_shared_taxi_config.xml +++ b/examples/scenarios/dvrp-grid/one_shared_taxi_config.xml @@ -13,10 +13,12 @@ - - - - + + + + + + diff --git a/examples/scenarios/dvrp-grid/one_taxi_and_one_shared_taxi_config.xml b/examples/scenarios/dvrp-grid/one_taxi_and_one_shared_taxi_config.xml index 4d953cfcf33..1f1f0a1b3fa 100644 --- a/examples/scenarios/dvrp-grid/one_taxi_and_one_shared_taxi_config.xml +++ b/examples/scenarios/dvrp-grid/one_taxi_and_one_shared_taxi_config.xml @@ -8,9 +8,12 @@ - - - + + + + + + diff --git a/examples/scenarios/kelheim/config-with-drt.xml b/examples/scenarios/kelheim/config-with-drt.xml index 7657d679502..65d678e96d3 100644 --- a/examples/scenarios/kelheim/config-with-drt.xml +++ b/examples/scenarios/kelheim/config-with-drt.xml @@ -243,15 +243,17 @@ - - - - - - - - - + + + + + + + + + + + @@ -286,15 +288,17 @@ - - - - - - - - - + + + + + + + + + + + diff --git a/examples/scenarios/mielec/mielec_drt_config.xml b/examples/scenarios/mielec/mielec_drt_config.xml index 403207359f5..6557f58136a 100644 --- a/examples/scenarios/mielec/mielec_drt_config.xml +++ b/examples/scenarios/mielec/mielec_drt_config.xml @@ -8,9 +8,11 @@ - - - + + + + + diff --git a/examples/scenarios/mielec/mielec_drt_config_v1.xml b/examples/scenarios/mielec/mielec_drt_config_v1.xml new file mode 100644 index 00000000000..403207359f5 --- /dev/null +++ b/examples/scenarios/mielec/mielec_drt_config_v1.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/scenarios/mielec/mielec_edrt_config.xml b/examples/scenarios/mielec/mielec_edrt_config.xml index 5ab35db759d..fa045f53415 100644 --- a/examples/scenarios/mielec/mielec_edrt_config.xml +++ b/examples/scenarios/mielec/mielec_edrt_config.xml @@ -13,9 +13,11 @@ - - - + + + + + diff --git a/examples/scenarios/mielec/mielec_multiModeEdrt_config.xml b/examples/scenarios/mielec/mielec_multiModeEdrt_config.xml index 2d20b7b5756..9f0ac950685 100644 --- a/examples/scenarios/mielec/mielec_multiModeEdrt_config.xml +++ b/examples/scenarios/mielec/mielec_multiModeEdrt_config.xml @@ -14,9 +14,11 @@ - - - + + + + + @@ -40,9 +42,11 @@ - - - + + + + + diff --git a/examples/scenarios/mielec/mielec_serviceArea_based_drt_config.xml b/examples/scenarios/mielec/mielec_serviceArea_based_drt_config.xml index ceb0ca0a3cb..98754db5f24 100644 --- a/examples/scenarios/mielec/mielec_serviceArea_based_drt_config.xml +++ b/examples/scenarios/mielec/mielec_serviceArea_based_drt_config.xml @@ -13,10 +13,11 @@ - - - - + + + + + diff --git a/examples/scenarios/mielec/mielec_stop_based_drt_config.xml b/examples/scenarios/mielec/mielec_stop_based_drt_config.xml index 5b9da8ef8d0..7d07ee1fd64 100644 --- a/examples/scenarios/mielec/mielec_stop_based_drt_config.xml +++ b/examples/scenarios/mielec/mielec_stop_based_drt_config.xml @@ -13,12 +13,14 @@ - - - + + + + + + + - -