Class NetworkParser
- java.lang.Object
-
- org.opentrafficsim.road.network.factory.xml.parser.NetworkParser
-
public final class NetworkParser extends Object
NetworkParser parses the NETWORK tag of the OTS network.Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classNetworkParser.CSEDatacontains information about the lanes and stripes to calculate the offset.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Direction>calculateNodeAngles(OTSRoadNetwork otsNetwork, NETWORK network)Calculate the default angles of the Nodes, in case they have not been set.static voidparseNodes(OTSRoadNetwork otsNetwork, NETWORK network, Map<String,Direction> nodeDirections)Parse the Nodes.
-
-
-
Method Detail
-
parseNodes
public static void parseNodes(OTSRoadNetwork otsNetwork, NETWORK network, Map<String,Direction> nodeDirections) throws NetworkException
Parse the Nodes.- Parameters:
otsNetwork- OTSRoadNetwork; the network to insert the parsed objects innetwork- NETWORK; the NETWORK tagnodeDirections- Map<String,Direction>; a map of the node ids and their default directions- Throws:
NetworkException- when the objects cannot be inserted into the network due to inconsistencies
-
calculateNodeAngles
public static Map<String,Direction> calculateNodeAngles(OTSRoadNetwork otsNetwork, NETWORK network)
Calculate the default angles of the Nodes, in case they have not been set. This is based on the STRAIGHT LINK elements in the XML file.- Parameters:
otsNetwork- OTSRoadNetwork; the network to insert the parsed objects innetwork- NETWORK; the NETWORK tag- Returns:
- a map of nodes and their default direction
-
-