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-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Copyright (c) 2003-2018 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
- 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
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 Details
-
parseNodes
public static void parseNodes(OTSRoadNetwork otsNetwork, NETWORK network, Map<String,Direction> nodeDirections) throws NetworkExceptionParse 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
-