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.
Author:
Alexander Verbraeck
  • Method Details

    • 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 in
      network - NETWORK; the NETWORK tag
      nodeDirections - 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 in
      network - NETWORK; the NETWORK tag
      Returns:
      a map of nodes and their default direction