Skip to content

Commit 7936c8f

Browse files
steffenaxerdependabot[bot]samuelhoenleCopilot
authored
feat(core): Implement customizable, time dependend CH router (#4859)
* feat(router): implement customizable CCH router with CATCHUp extension for time-dependent routing * feat(router): Add time-dependent CATCHUp bidirectional CH router (SpeedyCH) (#48) * build(deps): bump the all-dependencies group across 1 directory with 3 updates (#4845) Bumps the all-dependencies group with 3 updates in the / directory: [org.codehaus.woodstox:stax2-api](https://github.com/FasterXML/stax2-api), [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) and software.amazon.awssdk:bom. Updates `org.codehaus.woodstox:stax2-api` from 4.2.2 to 4.3.0 - [Commits](FasterXML/stax2-api@stax2-api-4.2.2...stax2-api-4.3.0) Updates `net.bytebuddy:byte-buddy` from 1.18.7 to 1.18.8 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](raphw/byte-buddy@byte-buddy-1.18.7...byte-buddy-1.18.8) Updates `software.amazon.awssdk:bom` from 2.42.23 to 2.42.25 --- updated-dependencies: - dependency-name: org.codehaus.woodstox:stax2-api dependency-version: 4.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-dependencies - dependency-name: net.bytebuddy:byte-buddy dependency-version: 1.18.8 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: software.amazon.awssdk:bom dependency-version: 2.42.25 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(drt): Compute sharing metrics per DRT mode (#4844) * feat(drt): Enable SpeedyCH time-dependent router for DRT insertion search (#49) * feat(router): add build statistics tracking for CH contraction process * feat(benchmark): enhance DRT benchmark with request inserter types and insertion search strategies * fix(dvrp): fix ArrayIndexOutOfBoundsException in CHRouter + OneToManyPathCalculator (#50) * feat(benchmark): update insertion search strategy to RepeatedSelective * fix test * fix(router): Make CH router fully deterministic (#51) * feat(router): Add time-dependent CATCHUp bidirectional CH router (SpeedyCH) (#48) * build(deps): bump the all-dependencies group across 1 directory with 3 updates (#4845) Bumps the all-dependencies group with 3 updates in the / directory: [org.codehaus.woodstox:stax2-api](https://github.com/FasterXML/stax2-api), [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) and software.amazon.awssdk:bom. Updates `org.codehaus.woodstox:stax2-api` from 4.2.2 to 4.3.0 - [Commits](FasterXML/stax2-api@stax2-api-4.2.2...stax2-api-4.3.0) Updates `net.bytebuddy:byte-buddy` from 1.18.7 to 1.18.8 - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](raphw/byte-buddy@byte-buddy-1.18.7...byte-buddy-1.18.8) Updates `software.amazon.awssdk:bom` from 2.42.23 to 2.42.25 --- updated-dependencies: - dependency-name: org.codehaus.woodstox:stax2-api dependency-version: 4.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-dependencies - dependency-name: net.bytebuddy:byte-buddy dependency-version: 1.18.8 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: software.amazon.awssdk:bom dependency-version: 2.42.25 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(drt): Compute sharing metrics per DRT mode (#4844) * feat(drt): Enable SpeedyCH time-dependent router for DRT insertion search (#49) * feat(router): add build statistics tracking for CH contraction process * feat(benchmark): enhance DRT benchmark with request inserter types and insertion search strategies * fix(dvrp): fix ArrayIndexOutOfBoundsException in CHRouter + OneToManyPathCalculator (#50) * feat(benchmark): update insertion search strategy to RepeatedSelective * fix test * fix: translate colored node indices through spatial reorder mapping and fix tests - Add SpeedyGraph.getInternalIndex(int) for raw external index translation - Fix LeastCostPathTree colored node index in forward/backward search - Fix SpeedyDijkstra, SpeedyALT, CHRouter, CHRouterTimeDep colored node indices - Fix SpeedyMultiSourceALT to use graph.getNodeIndex() instead of node.getId().index() - Fix LeastCostPathTreeTurnRestrictionsTest to use tree.getNodeIndex() - Update ReRoutingIT CH test: verify simulation succeeds instead of golden reference (CH construction is non-deterministic with spatial node ordering) Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/934c5dff-2a0c-4f13-9449-51662b958f4e Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> * fix: deterministic Morton code tie-breaking and restore ReRoutingIT CH golden reference test Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/934c5dff-2a0c-4f13-9449-51662b958f4e Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> * fix: make CH router fully deterministic and regenerate golden reference Two sources of non-determinism fixed: 1. InertialFlowCutter: Replace shared AtomicInteger levelCounter in parallel recursion with a two-phase approach: Phase 1 builds a deterministic NDCell tree (parallel), Phase 2 assigns levels via sequential depth-first walk. 2. CHBuilder: Disable parallel contraction (pool=null) because cells in the same round share adjacency structures — shortcuts from one cell can affect another cell's witness search, creating different shortcut sets per run. Additionally, sort each node's CSR edges by (neighborNode, origLink) in buildCHGraph() for deterministic edge iteration order. Verified deterministic across multiple runs: - ReRoutingIT: 4/4 pass (3 consecutive runs identical) - CH/Speedy tests: 81/81 pass - dvrp tests: 79/79 pass Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/ea70a0e9-8db0-4344-99a7-1895ad33d191 Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Samuel Hönle <samuel.hoenle@ait.ac.at> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> * feat(router): optimize subgraph refinement thresholds and enhance logging for benchmarks * fix(test) * feat(router): Improve CHRouter * Update plans_CH.xml.gz to match * fix(SpeedyGraphBuilder): scope Z-order node reordering to CHRouter only (#52) * feat(router): set default locale to US for consistent number formatting in benchmarks * feat(router): enhance CHBuilder to support configurable thread count for parallel contraction * fix(CHRouterFactory): add no-arg constructor for backward compatibility (#53) The CHRouterFactory constructor was changed to require GlobalConfigGroup, but SingleInsertionDetourPathCalculator uses a no-arg new CHRouterFactory(). This broke compilation of drt and all its dependents (taxi, commercialTrafficApplications, accessibility, integration, av, vsp, simwrapper). Add a no-arg constructor that delegates to the injected constructor with default GlobalConfigGroup (nThreads=2), preserving backward compatibility. Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/a7a83643-0bb5-4cff-8f3b-6193cd701ab6 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> * fix: revert SpeedyALTData.java to upstream/main (NodeMinHeap) for retrofit compatibility Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/e1a1e82f-b09c-41cd-9319-42406ce7ec6d Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> * fix: restore test reference files from upstream/main after SpeedyALTData revert Agent-Logs-Url: https://github.com/steffenaxer/matsim-libs/sessions/cf1afc12-dd97-4e8d-9e31-f35d2246886f Co-authored-by: steffenaxer <26229392+steffenaxer@users.noreply.github.com> * refactor(benchmark): move RouterBenchmark to benchmark module * refactor(benchmark): move RouterBenchmark (real-network, CH+ALT) to benchmark module - Replace synthetic-grid version with the real RouterBenchmark from speedy package - Make SpeedyALTData public, add CHGraph.getTotalEdgeCount() and SpeedyGraph.getNodeCount() - Use SpeedyGraphBuilder.buildWithSpatialOrdering() instead of deprecated build() * Add some more stats * Fix SpeedyALTData * refactor: update routing algorithm configuration and remove deprecated methods * refactor: enhance OD pair generation with new modes and statistics * Refactor InertialFlowCutter * Update config * refactor: improve CHRouter test suite and enhance turn restriction handling * refactor: enhance CHRouter with turn restriction handling and add static test suite * Delete dev. code * fix: update reference file to check determinism --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Samuel Hönle <samuel.hoenle@ait.ac.at> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 1ca2324 commit 7936c8f

64 files changed

Lines changed: 13282 additions & 305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

benchmark/src/main/java/org/matsim/benchmark/RouterBenchmark.java

Lines changed: 641 additions & 0 deletions
Large diffs are not rendered by default.

contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/benchmark/DrtBenchmarkConfigGroup.java

Lines changed: 172 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.matsim.core.config.Config;
1313
import org.matsim.core.config.ConfigGroup;
1414
import org.matsim.core.config.ReflectiveConfigGroup;
15+
import org.matsim.core.config.groups.ControllerConfigGroup;
1516

1617
import java.util.Arrays;
1718
import java.util.List;
@@ -26,6 +27,8 @@
2627
* <module name="drtBenchmark">
2728
* <param name="agentCounts" value="50000,100000"/>
2829
* <param name="vehiclesPerHundredAgents" value="1"/>
30+
* <param name="requestInserterTypes" value="Default,Parallel"/>
31+
* <param name="insertionSearchStrategies" value="Selective,Extensive"/>
2932
* <param name="vehiclePartitioners" value="Replicating,RoundRobin"/>
3033
* <param name="requestPartitioners" value="RoundRobin,LoadAware"/>
3134
* <param name="collectionPeriods" value="90"/>
@@ -105,7 +108,73 @@ public void setVehiclesPerHundredAgents(int vehiclesPerHundredAgents) {
105108
}
106109

107110
// =========================================================================
108-
// Partitioner Configuration
111+
// Request Inserter & Insertion Search Configuration
112+
// =========================================================================
113+
114+
private static final String REQUEST_INSERTER_TYPES = "requestInserterTypes";
115+
private static final String INSERTION_SEARCH_STRATEGIES = "insertionSearchStrategies";
116+
117+
@Comment("Comma-separated list of request inserter types to benchmark. " +
118+
"Options: Default, Parallel. " +
119+
"'Default' uses the standard sequential DefaultUnplannedRequestInserter. " +
120+
"'Parallel' uses the partitioned ParallelUnplannedRequestInserter (requires partitioner settings).")
121+
@NotBlank
122+
private String requestInserterTypes = "Default";
123+
124+
@Comment("Comma-separated list of insertion search strategies to benchmark. " +
125+
"Options: Selective, Extensive, RepeatedSelective. " +
126+
"Each search strategy is combined with each inserter type (cross-product).")
127+
@NotBlank
128+
private String insertionSearchStrategies = "Selective";
129+
130+
@StringGetter(REQUEST_INSERTER_TYPES)
131+
public String getRequestInserterTypesString() {
132+
return requestInserterTypes;
133+
}
134+
135+
@StringSetter(REQUEST_INSERTER_TYPES)
136+
public void setRequestInserterTypesString(String requestInserterTypes) {
137+
this.requestInserterTypes = requestInserterTypes;
138+
}
139+
140+
public List<InsertionStrategy.RequestInserterType> getRequestInserterTypes() {
141+
return Arrays.stream(requestInserterTypes.split(","))
142+
.map(String::trim)
143+
.map(this::parseRequestInserterType)
144+
.collect(Collectors.toList());
145+
}
146+
147+
public void setRequestInserterTypes(List<InsertionStrategy.RequestInserterType> types) {
148+
this.requestInserterTypes = types.stream()
149+
.map(Enum::name)
150+
.collect(Collectors.joining(","));
151+
}
152+
153+
@StringGetter(INSERTION_SEARCH_STRATEGIES)
154+
public String getInsertionSearchStrategiesString() {
155+
return insertionSearchStrategies;
156+
}
157+
158+
@StringSetter(INSERTION_SEARCH_STRATEGIES)
159+
public void setInsertionSearchStrategiesString(String insertionSearchStrategies) {
160+
this.insertionSearchStrategies = insertionSearchStrategies;
161+
}
162+
163+
public List<InsertionStrategy.InsertionSearchStrategy> getInsertionSearchStrategies() {
164+
return Arrays.stream(insertionSearchStrategies.split(","))
165+
.map(String::trim)
166+
.map(this::parseInsertionSearchStrategy)
167+
.collect(Collectors.toList());
168+
}
169+
170+
public void setInsertionSearchStrategies(List<InsertionStrategy.InsertionSearchStrategy> strategies) {
171+
this.insertionSearchStrategies = strategies.stream()
172+
.map(Enum::name)
173+
.collect(Collectors.joining(","));
174+
}
175+
176+
// =========================================================================
177+
// Partitioner Configuration (only applies to Parallel strategy)
109178
// =========================================================================
110179

111180
private static final String VEHICLE_PARTITIONERS = "vehiclePartitioners";
@@ -175,6 +244,7 @@ public void setRequestPartitioners(List<RequestsPartitioner> partitioners) {
175244
private static final String MAX_PARTITIONS = "maxPartitions";
176245
private static final String MAX_ITERATIONS = "maxIterations";
177246
private static final String LOG_PERFORMANCE_STATS = "logPerformanceStats";
247+
private static final String MATRIX_CELL_SIZE = "matrixCellSize";
178248

179249
@Comment("Comma-separated list of collection periods in seconds to test (e.g., '60,90,120')")
180250
private String collectionPeriods = "90";
@@ -190,6 +260,11 @@ public void setRequestPartitioners(List<RequestsPartitioner> partitioners) {
190260
@Comment("Log detailed performance statistics for each partition")
191261
private boolean logPerformanceStats = true;
192262

263+
@Comment("Cell size [m] for the DVRP travel-time matrix square-grid zone system. " +
264+
"Larger values reduce matrix zones/memory/time; smaller values increase precision.")
265+
@Positive
266+
private double matrixCellSize = 200.0;
267+
193268
@StringGetter(COLLECTION_PERIODS)
194269
public String getCollectionPeriodsString() {
195270
return collectionPeriods;
@@ -238,6 +313,16 @@ public void setLogPerformanceStats(boolean logPerformanceStats) {
238313
this.logPerformanceStats = logPerformanceStats;
239314
}
240315

316+
@StringGetter(MATRIX_CELL_SIZE)
317+
public double getMatrixCellSize() {
318+
return matrixCellSize;
319+
}
320+
321+
@StringSetter(MATRIX_CELL_SIZE)
322+
public void setMatrixCellSize(double matrixCellSize) {
323+
this.matrixCellSize = matrixCellSize;
324+
}
325+
241326
// =========================================================================
242327
// Benchmark Settings
243328
// =========================================================================
@@ -279,6 +364,8 @@ public void setMeasuredRuns(int measuredRuns) {
279364

280365
private static final String OUTPUT_DIRECTORY = "outputDirectory";
281366
private static final String USE_SPATIAL_FILTER = "useSpatialFilter";
367+
private static final String DETOUR_PATH_CALCULATOR_TYPES = "detourPathCalculatorTypes";
368+
private static final String NETWORK_URL = "networkUrl";
282369

283370
@Comment("Output directory for benchmark results (timestamp subfolder will be created)")
284371
@NotBlank
@@ -287,6 +374,17 @@ public void setMeasuredRuns(int measuredRuns) {
287374
@Comment("Enable spatial request-fleet filter (reduces search space)")
288375
private boolean useSpatialFilter = true;
289376

377+
@Comment("Comma-separated list of routing algorithm types for detour path computation. " +
378+
"Options: SpeedyALT, CHRouter. " +
379+
"Maps directly to config.controller.routingAlgorithmType.")
380+
@NotBlank
381+
private String detourPathCalculatorTypes = "SpeedyALT";
382+
383+
@Comment("URL or file path to a MATSim network file (xml or xml.gz). " +
384+
"If empty, a synthetic grid network is generated. " +
385+
"Example: https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v7.0/input/berlin-v7.0-network.xml.gz")
386+
private String networkUrl = "";
387+
290388
@StringGetter(OUTPUT_DIRECTORY)
291389
public String getOutputDirectory() {
292390
return outputDirectory;
@@ -307,6 +405,43 @@ public void setUseSpatialFilter(boolean useSpatialFilter) {
307405
this.useSpatialFilter = useSpatialFilter;
308406
}
309407

408+
@StringGetter(DETOUR_PATH_CALCULATOR_TYPES)
409+
public String getDetourPathCalculatorTypesString() {
410+
return detourPathCalculatorTypes;
411+
}
412+
413+
@StringSetter(DETOUR_PATH_CALCULATOR_TYPES)
414+
public void setDetourPathCalculatorTypesString(String detourPathCalculatorTypes) {
415+
this.detourPathCalculatorTypes = detourPathCalculatorTypes;
416+
}
417+
418+
public List<ControllerConfigGroup.RoutingAlgorithmType> getRoutingAlgorithmTypes() {
419+
return Arrays.stream(detourPathCalculatorTypes.split(","))
420+
.map(String::trim)
421+
.map(this::parseRoutingAlgorithmType)
422+
.collect(Collectors.toList());
423+
}
424+
425+
public void setRoutingAlgorithmTypes(List<ControllerConfigGroup.RoutingAlgorithmType> types) {
426+
this.detourPathCalculatorTypes = types.stream()
427+
.map(Enum::name)
428+
.collect(Collectors.joining(","));
429+
}
430+
431+
@StringGetter(NETWORK_URL)
432+
public String getNetworkUrl() {
433+
return networkUrl;
434+
}
435+
436+
@StringSetter(NETWORK_URL)
437+
public void setNetworkUrl(String networkUrl) {
438+
this.networkUrl = networkUrl;
439+
}
440+
441+
public boolean hasExternalNetwork() {
442+
return networkUrl != null && !networkUrl.isBlank();
443+
}
444+
310445
// =========================================================================
311446
// Helper Methods
312447
// =========================================================================
@@ -353,20 +488,53 @@ private String requestPartitionerToString(RequestsPartitioner rp) {
353488
};
354489
}
355490

491+
private InsertionStrategy.RequestInserterType parseRequestInserterType(String name) {
492+
return switch (name.toLowerCase()) {
493+
case "default" -> InsertionStrategy.RequestInserterType.Default;
494+
case "parallel" -> InsertionStrategy.RequestInserterType.Parallel;
495+
default -> throw new IllegalArgumentException("Unknown request inserter type: " + name +
496+
". Valid options: Default, Parallel");
497+
};
498+
}
499+
500+
private InsertionStrategy.InsertionSearchStrategy parseInsertionSearchStrategy(String name) {
501+
return switch (name.toLowerCase()) {
502+
case "selective" -> InsertionStrategy.InsertionSearchStrategy.Selective;
503+
case "extensive" -> InsertionStrategy.InsertionSearchStrategy.Extensive;
504+
case "repeatedselective" -> InsertionStrategy.InsertionSearchStrategy.RepeatedSelective;
505+
default -> throw new IllegalArgumentException("Unknown insertion search strategy: " + name +
506+
". Valid options: Selective, Extensive, RepeatedSelective");
507+
};
508+
}
509+
510+
private ControllerConfigGroup.RoutingAlgorithmType parseRoutingAlgorithmType(String name) {
511+
return switch (name.toLowerCase()) {
512+
case "speedyalt", "speedy" -> ControllerConfigGroup.RoutingAlgorithmType.SpeedyALT;
513+
case "ch", "chrouter" -> ControllerConfigGroup.RoutingAlgorithmType.CHRouter;
514+
default -> throw new IllegalArgumentException("Unknown detour path calculator type: " + name +
515+
". Valid options: SpeedyALT, CHRouter");
516+
};
517+
}
518+
356519
@Override
357520
public Map<String, String> getComments() {
358521
Map<String, String> comments = super.getComments();
359522
comments.put(AGENT_COUNTS, "Comma-separated list of agent counts to test (e.g., '50000,100000,200000')");
360523
comments.put(VEHICLES_PER_HUNDRED_AGENTS, "Number of vehicles per 100 agents");
361-
comments.put(VEHICLE_PARTITIONERS, "Vehicle partitioners: Replicating, RoundRobin, ShiftingRoundRobin");
362-
comments.put(REQUEST_PARTITIONERS, "Request partitioners: RoundRobin, LoadAware");
363-
comments.put(COLLECTION_PERIODS, "Collection periods in seconds (comma-separated)");
524+
comments.put(REQUEST_INSERTER_TYPES, "Request inserter types: Default, Parallel");
525+
comments.put(INSERTION_SEARCH_STRATEGIES, "Insertion search strategies: Selective, Extensive, RepeatedSelective");
526+
comments.put(VEHICLE_PARTITIONERS, "Vehicle partitioners (Parallel inserter only): Replicating, RoundRobin, ShiftingRoundRobin");
527+
comments.put(REQUEST_PARTITIONERS, "Request partitioners (Parallel inserter only): RoundRobin, LoadAware");
528+
comments.put(COLLECTION_PERIODS, "Collection periods in seconds (Parallel inserter only, comma-separated)");
364529
comments.put(MAX_PARTITIONS, "Number of parallel partitions");
365530
comments.put(MAX_ITERATIONS, "Max iterations for parallel inserter");
531+
comments.put(MATRIX_CELL_SIZE, "Cell size [m] for DVRP TT matrix zones (larger = fewer zones)");
366532
comments.put(WARMUP_RUNS, "Number of warmup runs");
367533
comments.put(MEASURED_RUNS, "Number of measured runs");
368534
comments.put(OUTPUT_DIRECTORY, "Output directory for results");
369535
comments.put(USE_SPATIAL_FILTER, "Enable spatial filter");
536+
comments.put(DETOUR_PATH_CALCULATOR_TYPES, "Detour path calculator types: SpeedyALT, CHRouter");
537+
comments.put(NETWORK_URL, "URL or file path to a MATSim network (empty = synthetic grid)");
370538
return comments;
371539
}
372540
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* *********************************************************************** *
2+
* project: org.matsim.*
3+
* *********************************************************************** */
4+
5+
package org.matsim.contrib.drt.extension.benchmark;
6+
7+
/**
8+
* Enums for DRT benchmark configuration.
9+
* <p>
10+
* The benchmark has two orthogonal dimensions:
11+
* <ul>
12+
* <li>{@link RequestInserterType} – HOW requests are dispatched (Default sequential vs. Parallel partitioned)</li>
13+
* <li>{@link InsertionSearchStrategy} – WHICH algorithm finds the best insertion for a request</li>
14+
* </ul>
15+
* The routing algorithm type for detour path computation is configured via
16+
* {@link org.matsim.core.config.groups.ControllerConfigGroup.RoutingAlgorithmType} directly
17+
* (e.g. {@code SpeedyALT}, {@code CHRouter}).
18+
*
19+
* @author Steffen Axer
20+
*/
21+
public final class InsertionStrategy {
22+
private InsertionStrategy() {} // utility class
23+
24+
/**
25+
* The request inserter type controls how requests are dispatched to vehicles.
26+
* <ul>
27+
* <li><b>Default</b> – sequential processing via {@code DefaultUnplannedRequestInserter}</li>
28+
* <li><b>Parallel</b> – partitioned parallel processing via {@code ParallelUnplannedRequestInserter}
29+
* (requires partitioner and collection period configuration)</li>
30+
* </ul>
31+
*/
32+
public enum RequestInserterType {
33+
Default, Parallel
34+
}
35+
36+
/**
37+
* The insertion search strategy used to find the best insertion of a request into a vehicle schedule.
38+
* <ul>
39+
* <li><b>Selective</b> – fast heuristic, finds a single best insertion using beeline-distance pre-filtering</li>
40+
* <li><b>Extensive</b> – evaluates all feasible insertions for each request</li>
41+
* <li><b>RepeatedSelective</b> – retries selective search multiple times for better quality</li>
42+
* </ul>
43+
*/
44+
public enum InsertionSearchStrategy {
45+
Selective, Extensive, RepeatedSelective
46+
}
47+
}
48+

0 commit comments

Comments
 (0)