Class ConflictBuilderParallel
java.lang.Object
org.opentrafficsim.road.network.lane.conflict.ConflictBuilderParallel
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) static class
static class
Generator with fixed width.static class
Generator with width factor on actual lane width.static interface
Generator for width. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConflictBuilderParallel.WidthGenerator
Default width generator for conflicts which uses 80% of the lane width. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
buildConflicts
(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) Build conflicts on list of lanes.(package private) static void
Build conflicts for one record.(package private) static void
buildConflicts
(Lane lane1, Set<Lane> down1, Set<Lane> up1, Lane lane2, Set<Lane> down2, Set<Lane> up2, boolean permitted, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, Map<Lane, OtsLine3d> leftEdges, Map<Lane, OtsLine3d> rightEdges) Build conflicts on single lane pair.static void
buildConflicts
(Lane lane1, Lane lane2, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) Build conflict on single lane pair.static void
buildConflicts
(Lane lane1, Lane lane2, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, boolean permitted) Build conflict on single lane pair.static void
buildConflicts
(RoadNetwork network, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) Build conflicts on network.static void
buildConflicts
(RoadNetwork network, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) Build conflicts on network.static void
buildConflictsParallelBig
(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) Build conflicts on list of lanes.static void
buildConflictsParallelSmall
(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) Build conflicts on list of lanes.
-
Field Details
-
DEFAULT_WIDTH_GENERATOR
Default width generator for conflicts which uses 80% of the lane width.
-
-
Method Details
-
buildConflicts
public static void buildConflicts(RoadNetwork network, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) throws OtsGeometryException Build conflicts on network.- Parameters:
network
- RoadNetwork; networksimulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generator- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflicts
public static void buildConflicts(RoadNetwork network, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) throws OtsGeometryException Build conflicts on network.- Parameters:
network
- RoadNetwork; networksimulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generatorignoreList
- LaneCombinationList; lane combinations to ignorepermittedList
- LaneCombinationList; lane combinations that are permitted by traffic control- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflicts
public static void buildConflicts(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) throws OtsGeometryException Build conflicts on list of lanes.- Parameters:
lanes
- List<Lane>; lanessimulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generator- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflictsParallelSmall
public static void buildConflictsParallelSmall(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) throws OtsGeometryException Build conflicts on list of lanes. Small jobs for parallelization.- Parameters:
lanes
- List<Lane>; list of Lanessimulator
- OtsSimulatorInterface; the simulatorwidthGenerator
- WidthGenerator; the width generatorignoreList
- LaneCombinationList; lane combinations to ignorepermittedList
- LaneCombinationList; lane combinations that are permitted by traffic control- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflictsParallelBig
public static void buildConflictsParallelBig(List<Lane> lanes, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, LaneCombinationList ignoreList, LaneCombinationList permittedList) throws OtsGeometryException Build conflicts on list of lanes. Parallelize bigger jobs- Parameters:
lanes
- List<Lane>; list of Lanessimulator
- OtsSimulatorInterface; the simulatorwidthGenerator
- WidthGenerator; the width generatorignoreList
- LaneCombinationList; lane combinations to ignorepermittedList
- LaneCombinationList; lane combinations that are permitted by traffic control- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflicts
Build conflicts for one record.- Parameters:
cbr
- the lane record
-
buildConflicts
public static void buildConflicts(Lane lane1, Lane lane2, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator) throws OtsGeometryException Build conflict on single lane pair. Connecting lanes are determined.- Parameters:
lane1
- Lane; lane 1lane2
- Lane; lane 2simulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generator- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflicts
public static void buildConflicts(Lane lane1, Lane lane2, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, boolean permitted) throws OtsGeometryException Build conflict on single lane pair. Connecting lanes are determined.- Parameters:
lane1
- Lane; lane 1lane2
- Lane; lane 2simulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generatorpermitted
- boolean; conflict permitted by traffic control- Throws:
OtsGeometryException
- in case of geometry exception
-
buildConflicts
static void buildConflicts(Lane lane1, Set<Lane> down1, Set<Lane> up1, Lane lane2, Set<Lane> down2, Set<Lane> up2, boolean permitted, OtsSimulatorInterface simulator, ConflictBuilderParallel.WidthGenerator widthGenerator, Map<Lane, OtsLine3d> leftEdges, Map<Lane, throws OtsGeometryException, NetworkExceptionOtsLine3d> rightEdges) Build conflicts on single lane pair.- Parameters:
lane1
- Lane; lane 1down1
- Set<Lane>; downstream lanes 1up1
- Set<Lane>; upstream lanes 1lane2
- Lane; lane 2down2
- Set<Lane>; downstream lane 2up2
- Set<Lane>; upstream lanes 2permitted
- boolean; conflict permitted by traffic controlsimulator
- OtsSimulatorInterface; simulatorwidthGenerator
- WidthGenerator; width generatorleftEdges
- Map<Lane, OtsLine3d>; cache of left edge linesrightEdges
- Map<Lane, OtsLine3d>; cache of right edge lines- Throws:
OtsGeometryException
- in case of geometry exceptionNetworkException
- if the combination of conflict type and both conflict rules is not correct
-