Class NetworkParser


  • public final class NetworkParser
    extends java.lang.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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  NetworkParser.CSEData
      contains information about the lanes and stripes to calculate the offset.
    • Method Detail

      • parseNodes

        public static void parseNodes​(OTSRoadNetwork otsNetwork,
                                      NETWORK network,
                                      java.util.Map<java.lang.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 java.util.Map<java.lang.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