Class TransportModelNetwork


  • public class TransportModelNetwork
    extends Object
    Entire transport network that is being modeled including both the physical and virtual aspects of it as well as the zoning. It acts as a wrapper unifying the two components during the assignment stage
    Author:
    markr
    • Field Detail

      • infrastructureNetwork

        protected final TopologicalLayerNetwork<?,​?> infrastructureNetwork
        Holds the infrastructure road network that is being modelled
      • zoning

        protected final Zoning zoning
        Holds the zoning structure and virtual transport network interfacing with the physical network
    • Constructor Detail

      • TransportModelNetwork

        public TransportModelNetwork​(TopologicalLayerNetwork<?,​?> infrastructureNetwork,
                                     Zoning zoning)
        Constructor
        Parameters:
        infrastructureNetwork - the network used to generate this TransportNetwork
        zoning - the Zoning used to generate this TransportNetwork
    • Method Detail

      • connectVerticesToEdge

        protected void connectVerticesToEdge​(Edge edge)
        Add Edge to both vertices
        Parameters:
        edge - Edge to be added to upstream and downstream vertices
      • disconnectVerticesFromEdge

        protected void disconnectVerticesFromEdge​(Edge edge)
        Remove Edge from both vertices
        Parameters:
        edge - Edge to be removed from upstream and downstream vertices
      • createAndRegisterConnectoidEdgeSegments

        protected void createAndRegisterConnectoidEdgeSegments​(ConnectoidSegmentFactory connectoidSegmentFactory,
                                                               ConnectoidEdge connectoidEdge)
        create and register the edge segments for the passed in connectoid edge, XML id set to id prefixed with "c_ab or c_ba".
        Parameters:
        connectoidSegmentFactory - to create and register on
        connectoidEdge - to process
      • createAndRegisterConnectoidEdgeAndEdgeSegments

        protected void createAndRegisterConnectoidEdgeAndEdgeSegments​(ConnectoidEdgeFactory connectoidEdgeFactory,
                                                                      ConnectoidSegmentFactory connectoidSegmentFactory,
                                                                      CentroidVertex centroidVertex,
                                                                      Zone accessZone,
                                                                      Connectoid connectoid,
                                                                      PlanitJtsCrsUtils geoTools)
        Given context of centroid vertex and connectoid + access zone, we create the required connectoid edges and connected segments with the provided factories
        Parameters:
        connectoidEdgeFactory - factory to use
        connectoidSegmentFactory - factory to use
        centroidVertex - centroid vertex created for the access zone
        accessZone - at hand for the current connectoid
        connectoid - the connectoid at hand used to extract length to access zone
        geoTools - to use for geometry creation
      • getNumberOfEdgeSegmentsAllLayers

        public static int getNumberOfEdgeSegmentsAllLayers​(LayeredNetwork<?,​?> theNetwork,
                                                           Zoning theZoning)
        Returns the total number of edge segments available in this traffic assignment by combining the physical and non-physical link segments
        Parameters:
        theNetwork - to use
        theZoning - to use
        Returns:
        total number of physical and virtual edge segments
      • getNumberOfConnectoidSegments

        public static int getNumberOfConnectoidSegments​(Zoning theZoning)
        Returns the total number of connectoid segments available in this transport network
        Parameters:
        theZoning - to use
        Returns:
        the number of connectoid segments in this network
      • getNumberOfPhysicalLinkSegmentsAllLayers

        public static int getNumberOfPhysicalLinkSegmentsAllLayers​(LayeredNetwork<?,​?> theNetwork)
        Returns the total number of link segments available in this physical layered network across all eligible layers
        Parameters:
        theNetwork - to use
        Returns:
        the number of physical link segments in this network
      • getNumberOfVerticesAllLayers

        public static int getNumberOfVerticesAllLayers​(LayeredNetwork<?,​?> physicalNetwork,
                                                       Zoning zoning)
        Returns the total physical vertices and centroid vertices (of od and/or transfer zones) in this transport network
        Parameters:
        physicalNetwork - to use
        zoning - to use
        Returns:
        the total number of vertices
      • getNumberOfPhysicalNodesAllLayers

        public static int getNumberOfPhysicalNodesAllLayers​(LayeredNetwork<?,​?> theNetwork)
        Returns the total number of physical nodes available in this transport network across all eligible layers
        Parameters:
        theNetwork - to use
        Returns:
        the number of physical nodes in this network
      • integrateTransportNetworkViaConnectoids

        public TransportModelNetwork integrateTransportNetworkViaConnectoids()
        Integrate physical and virtual links within od zones (undirected connectoid access node and centroid)
        Returns:
        return transport model network integration was performed on to allow chaining
      • getNumberOfEdgeSegmentsAllLayers

        public int getNumberOfEdgeSegmentsAllLayers()
        Returns the total number of edge segments available in this traffic assignment by combining the physical and non-physical link segments
        Returns:
        total number of physical and virtual edge segments
      • getNumberOfPhysicalLinkSegmentsAllLayers

        public int getNumberOfPhysicalLinkSegmentsAllLayers()
        Returns the total number of link segments available in this transport network across all eligible layers
        Returns:
        the number of physical link segments in this network
      • getNumberOfConnectoidSegments

        public int getNumberOfConnectoidSegments()
        Returns the total number of connectoid segments available in this transport network
        Returns:
        the number of connectoid segments in this network
      • getNumberOfVerticesAllLayers

        public int getNumberOfVerticesAllLayers()
        Returns the total physical vertices and centroid vertices (of od and/or transfer zones) in this transport network
        Returns:
        the total number of vertices
      • getNumberOfPhysicalNodesAllLayers

        public int getNumberOfPhysicalNodesAllLayers()
        Returns the total number of physical nodes available in this transport network across all eligible layers
        Returns:
        the number of physical nodes in this network
      • removeVirtualNetworkFromPhysicalNetwork

        public void removeVirtualNetworkFromPhysicalNetwork()
        Remove the edges and edge segments on the vertices of both virtual and physical networks
      • getInfrastructureNetwork

        public TopologicalLayerNetwork<?,​?> getInfrastructureNetwork()
        Collect the physical network component of the transport network
        Returns:
        physicalNetwork
      • getVirtualNetwork

        public VirtualNetwork getVirtualNetwork()
        Collect the virtual network component of the transport network
        Returns:
        virtualNetwork
      • getZoning

        public Zoning getZoning()
        Collect the zoning structure
        Returns:
        zoning
      • createZoneToCentroidVertexMapping

        public Map<Zone,​CentroidVertex> createZoneToCentroidVertexMapping​(boolean OdZones,
                                                                                boolean transferZones)
        Create a (new) mapping from zones (transfer and or OD) to their centroid vertex.
        Parameters:
        OdZones - when true OdZones will be included in the mapping, not included otherwise
        transferZones - when true transferZones will be included in the mapping, not included otherwise
        Returns:
        mapping that was created