Package org.goplanit.network.virtual
Class VirtualNetworkImpl
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Network>
-
- org.goplanit.network.Network
-
- org.goplanit.network.virtual.VirtualNetworkImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
,VirtualNetwork
public class VirtualNetworkImpl extends Network implements VirtualNetwork
Model free virtual network which is part of the zoning and holds all the virtual infrastructure connecting the zones to the physical road network.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CentroidVerticesImpl
centroidVertices
Container for centroid verticesprotected ConnectoidEdgesImpl
connectoidEdges
Container for connectoid edgesprotected ConnectoidSegmentsImpl
connectoidSegments
Container for connectoid edge segments-
Fields inherited from class org.goplanit.network.Network
MACROSCOPIC_NETWORK, networkIdGroupingToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
VirtualNetworkImpl(VirtualNetworkImpl other, boolean deepCopy, GraphEntityDeepCopyMapper<ConnectoidEdge> connectoidEdgeMapper, GraphEntityDeepCopyMapper<ConnectoidSegment> connectoidSegmentMapper, GraphEntityDeepCopyMapper<CentroidVertex> centroidVertexMapper)
Copy constructorVirtualNetworkImpl(IdGroupingToken tokenId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
free up memory by clearing contents for garbage collectionConjugateVirtualNetworkImpl
createConjugate(IdGroupingToken idToken)
Create a conjugate version of this virtual network, also known as the edge-to-vertex-dual representation, where all connectoidedges/edge segments become (dangling) conjugate vertices.VirtualNetworkImpl
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleVirtualNetworkImpl
deepCloneWithMapping(GraphEntityDeepCopyMapper<ConnectoidEdge> connectoidEdgeMapper, GraphEntityDeepCopyMapper<ConnectoidSegment> connectoidSegmentMapper, GraphEntityDeepCopyMapper<CentroidVertex> centroidVertexMapper)
Perform a deep clone where mappings between original and copy are captured in the two provided mappersCentroidVertices
getCentroidVertices()
Access each centroid's vertexConnectoidEdges
getConnectoidEdges()
Access to connectoid edgesConnectoidSegments
getConnectoidSegments()
Access to connectoid segmentsboolean
isEmpty()
Verify if entire network is emptyvoid
logInfo(String prefix)
Log general information on this network to the uservoid
reset()
All components should be able to reset going back to some representative initial stateVirtualNetworkImpl
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.network.Network
collectSettingsAsKeyValueMap, getNetworkGroupingTokenId
-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.network.virtual.VirtualNetwork
hasConnectoidEdges, hasConnectoidSegments
-
-
-
-
Field Detail
-
connectoidEdges
protected final ConnectoidEdgesImpl connectoidEdges
Container for connectoid edges
-
connectoidSegments
protected final ConnectoidSegmentsImpl connectoidSegments
Container for connectoid edge segments
-
centroidVertices
protected final CentroidVerticesImpl centroidVertices
Container for centroid vertices
-
-
Constructor Detail
-
VirtualNetworkImpl
public VirtualNetworkImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId
- contiguous id generation for instances of this class
-
VirtualNetworkImpl
protected VirtualNetworkImpl(VirtualNetworkImpl other, boolean deepCopy, GraphEntityDeepCopyMapper<ConnectoidEdge> connectoidEdgeMapper, GraphEntityDeepCopyMapper<ConnectoidSegment> connectoidSegmentMapper, GraphEntityDeepCopyMapper<CentroidVertex> centroidVertexMapper)
Copy constructor- Parameters:
other
- to clonedeepCopy
- when true, create a deep copy, shallow copy otherwiseconnectoidEdgeMapper
- to use for tracking mapping between original and copied entity (may be null)connectoidSegmentMapper
- to use for tracking mapping between original and copied entity (may be null)centroidVertexMapper
- to use for tracking mapping between original and copied entity (may be null)
-
-
Method Detail
-
getConnectoidSegments
public ConnectoidSegments getConnectoidSegments()
Access to connectoid segments- Specified by:
getConnectoidSegments
in interfaceVirtualNetwork
- Returns:
- connectoidSegments
-
getConnectoidEdges
public ConnectoidEdges getConnectoidEdges()
Access to connectoid edges- Specified by:
getConnectoidEdges
in interfaceVirtualNetwork
- Returns:
- connectoidEdges
-
getCentroidVertices
public CentroidVertices getCentroidVertices()
Access each centroid's vertex- Specified by:
getCentroidVertices
in interfaceVirtualNetwork
- Returns:
- connectoidEdges
-
clear
public void clear()
free up memory by clearing contents for garbage collection- Specified by:
clear
in interfaceVirtualNetwork
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
reset
in interfaceVirtualNetwork
- Overrides:
reset
in classNetwork
-
logInfo
public void logInfo(String prefix)
Log general information on this network to the user
-
isEmpty
public boolean isEmpty()
Verify if entire network is empty- Specified by:
isEmpty
in interfaceVirtualNetwork
- Specified by:
isEmpty
in classNetwork
- Returns:
- true if network is empty, false otherwise
-
createConjugate
public ConjugateVirtualNetworkImpl createConjugate(IdGroupingToken idToken)
Create a conjugate version of this virtual network, also known as the edge-to-vertex-dual representation, where all connectoidedges/edge segments become (dangling) conjugate vertices.It is recommended to first create the conjugate of this virtual network BEFORE creating conjugates of network layers. The latter takes a conjugate zoning as input such that it can connect the conjugate virtual nodes to the conjugate network layer where appropriate, otherwise these connections are ignored
- Specified by:
createConjugate
in interfaceVirtualNetwork
- Parameters:
idToken
- to use for conjugate entity creation- Returns:
- conjugate version of this virtual network's edges/edgesgments
-
shallowClone
public VirtualNetworkImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceVirtualNetwork
- Specified by:
shallowClone
in classNetwork
- Returns:
- shallow copy of entity
-
deepClone
public VirtualNetworkImpl deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
-
deepCloneWithMapping
public VirtualNetworkImpl deepCloneWithMapping(GraphEntityDeepCopyMapper<ConnectoidEdge> connectoidEdgeMapper, GraphEntityDeepCopyMapper<ConnectoidSegment> connectoidSegmentMapper, GraphEntityDeepCopyMapper<CentroidVertex> centroidVertexMapper)
Perform a deep clone where mappings between original and copy are captured in the two provided mappers- Specified by:
deepCloneWithMapping
in interfaceVirtualNetwork
- Parameters:
connectoidEdgeMapper
- to use for tracking mapping between original and copied entity (may be null)connectoidSegmentMapper
- to use for tracking mapping between original and copied entity (may be null)centroidVertexMapper
- to use for tracking mapping between original and copied entity (may be null)- Returns:
- deep copy
-
-