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 CentroidVerticesImplcentroidVerticesContainer for centroid verticesprotected ConnectoidEdgesImplconnectoidEdgesContainer for connectoid edgesprotected ConnectoidSegmentsImplconnectoidSegmentsContainer for connectoid edge segments-
Fields inherited from class org.goplanit.network.Network
MACROSCOPIC_NETWORK, networkIdGroupingToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVirtualNetworkImpl(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 voidclear()free up memory by clearing contents for garbage collectionConjugateVirtualNetworkImplcreateConjugate(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.VirtualNetworkImpldeepClone()deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleVirtualNetworkImpldeepCloneWithMapping(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 mappersCentroidVerticesgetCentroidVertices()Access each centroid's vertexConnectoidEdgesgetConnectoidEdges()Access to connectoid edgesConnectoidSegmentsgetConnectoidSegments()Access to connectoid segmentsbooleanisEmpty()Verify if entire network is emptyvoidlogInfo(String prefix)Log general information on this network to the uservoidreset()All components should be able to reset going back to some representative initial stateVirtualNetworkImplshallowClone()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:
getConnectoidSegmentsin interfaceVirtualNetwork- Returns:
- connectoidSegments
-
getConnectoidEdges
public ConnectoidEdges getConnectoidEdges()
Access to connectoid edges- Specified by:
getConnectoidEdgesin interfaceVirtualNetwork- Returns:
- connectoidEdges
-
getCentroidVertices
public CentroidVertices getCentroidVertices()
Access each centroid's vertex- Specified by:
getCentroidVerticesin interfaceVirtualNetwork- Returns:
- connectoidEdges
-
clear
public void clear()
free up memory by clearing contents for garbage collection- Specified by:
clearin interfaceVirtualNetwork
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
resetin interfaceVirtualNetwork- Overrides:
resetin 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:
isEmptyin interfaceVirtualNetwork- Specified by:
isEmptyin 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:
createConjugatein 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:
shallowClonein interfaceIdAble- Specified by:
shallowClonein interfaceVirtualNetwork- Specified by:
shallowClonein 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:
deepCloneWithMappingin 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
-
-