Package org.goplanit.network.transport
Class TransportModelNetwork
- java.lang.Object
-
- org.goplanit.network.transport.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 Summary
Fields Modifier and Type Field Description protected TopologicalLayerNetwork<?,?>
infrastructureNetwork
Holds the infrastructure road network that is being modelledprotected Zoning
zoning
Holds the zoning structure and virtual transport network interfacing with the physical network
-
Constructor Summary
Constructors Constructor Description TransportModelNetwork(TopologicalLayerNetwork<?,?> infrastructureNetwork, Zoning zoning)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connectVerticesToEdge(Edge edge)
Add Edge to both verticesprotected 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 factoriesprotected 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".Map<Zone,CentroidVertex>
createZoneToCentroidVertexMapping(boolean OdZones, boolean transferZones)
Create a (new) mapping from zones (transfer and or OD) to their centroid vertex.protected void
disconnectVerticesFromEdge(Edge edge)
Remove Edge from both verticesTopologicalLayerNetwork<?,?>
getInfrastructureNetwork()
Collect the physical network component of the transport networkint
getNumberOfConnectoidSegments()
Returns the total number of connectoid segments available in this transport networkstatic int
getNumberOfConnectoidSegments(Zoning theZoning)
Returns the total number of connectoid segments available in this transport networkint
getNumberOfEdgeSegmentsAllLayers()
Returns the total number of edge segments available in this traffic assignment by combining the physical and non-physical link segmentsstatic 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 segmentsint
getNumberOfPhysicalLinkSegmentsAllLayers()
Returns the total number of link segments available in this transport network across all eligible layersstatic int
getNumberOfPhysicalLinkSegmentsAllLayers(LayeredNetwork<?,?> theNetwork)
Returns the total number of link segments available in this physical layered network across all eligible layersint
getNumberOfPhysicalNodesAllLayers()
Returns the total number of physical nodes available in this transport network across all eligible layersstatic int
getNumberOfPhysicalNodesAllLayers(LayeredNetwork<?,?> theNetwork)
Returns the total number of physical nodes available in this transport network across all eligible layersint
getNumberOfVerticesAllLayers()
Returns the total physical vertices and centroid vertices (of od and/or transfer zones) in this transport networkstatic int
getNumberOfVerticesAllLayers(LayeredNetwork<?,?> physicalNetwork, Zoning zoning)
Returns the total physical vertices and centroid vertices (of od and/or transfer zones) in this transport networkVirtualNetwork
getVirtualNetwork()
Collect the virtual network component of the transport networkZoning
getZoning()
Collect the zoning structureTransportModelNetwork
integrateTransportNetworkViaConnectoids()
Integrate physical and virtual links within od zones (undirected connectoid access node and centroid)void
removeVirtualNetworkFromPhysicalNetwork()
Remove the edges and edge segments on the vertices of both virtual and physical networks
-
-
-
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 TransportNetworkzoning
- 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 onconnectoidEdge
- 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 useconnectoidSegmentFactory
- factory to usecentroidVertex
- centroid vertex created for the access zoneaccessZone
- at hand for the current connectoidconnectoid
- the connectoid at hand used to extract length to access zonegeoTools
- 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 usetheZoning
- 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 usezoning
- 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 otherwisetransferZones
- when true transferZones will be included in the mapping, not included otherwise- Returns:
- mapping that was created
-
-