Package org.goplanit.network
Class MacroscopicNetwork
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Network>
-
- org.goplanit.network.Network
-
- org.goplanit.network.LayeredNetwork<T,U>
-
- org.goplanit.network.TopologicalLayerNetwork<L,LS>
-
- org.goplanit.network.UntypedPhysicalNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
-
- org.goplanit.network.MacroscopicNetwork
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
- Direct Known Subclasses:
PlanitOsmNetwork
public class MacroscopicNetwork extends UntypedPhysicalNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
Macroscopic Network which stores one or more macroscopic network infrastructure layers that together form the complete (intermodal) network.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.goplanit.network.Network
MACROSCOPIC_NETWORK, networkIdGroupingToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MacroscopicNetwork(MacroscopicNetwork other, boolean deepCopy, ManagedIdDeepCopyMapper<Mode> modeMapper, ManagedIdDeepCopyMapper<MacroscopicNetworkLayer> layerMapper)
Copy constructor.MacroscopicNetwork(IdGroupingToken tokenId)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createAndRegisterLayers(MacroscopicNetworkLayerConfigurator layerConfiguration)
Tries to initialise and create/register layers via a predefined configuration rather than letting the user do this manually via the infrastructure layers container.protected MacroscopicNetworkLayersImpl
createLayersContainer(IdGroupingToken networkIdToken)
Derived type is to provide the actual layer implementationsstatic MacroscopicNetwork
createSimpleGrid(IdGroupingToken tokenId, int rows, int columns)
Create a macroscopic network instance using the id token provided and in addition generate a simple grid-based network layer for the predefined car mode, where each link is bi-directional and has a single link segment type with access for car (nothing else set).MacroscopicNetwork
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possiblevoid
logInfo(String prefix)
Log general information on this network to the userMacroscopicNetwork
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.network.UntypedPhysicalNetwork
removeDanglingSubnetworks, removeDanglingSubnetworks
-
Methods inherited from class org.goplanit.network.TopologicalLayerNetwork
createBoundingBox, getCoordinateReferenceSystem, setCoordinateReferenceSystem, transform
-
Methods inherited from class org.goplanit.network.LayeredNetwork
getLayerByMode, getLayerByPredefinedModeType, getModes, getTransportLayers, isEmpty, reset
-
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
-
-
-
-
Constructor Detail
-
MacroscopicNetwork
public MacroscopicNetwork(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId
- contiguous id generation within this group for instances of this class
-
MacroscopicNetwork
protected MacroscopicNetwork(MacroscopicNetwork other, boolean deepCopy, ManagedIdDeepCopyMapper<Mode> modeMapper, ManagedIdDeepCopyMapper<MacroscopicNetworkLayer> layerMapper)
Copy constructor.- Parameters:
other
- to clonedeepCopy
- when true, create a deep copy, shallow copy otherwisemodeMapper
- to use for tracking mapping between original and copied modeslayerMapper
- to use for tracking mapping between original and copied layers
-
-
Method Detail
-
createLayersContainer
protected MacroscopicNetworkLayersImpl createLayersContainer(IdGroupingToken networkIdToken)
Derived type is to provide the actual layer implementations- Specified by:
createLayersContainer
in classLayeredNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
- Parameters:
networkIdToken
- to use- Returns:
- infrastructure layers container
-
logInfo
public void logInfo(String prefix)
Description copied from class:Network
Log general information on this network to the user
-
createAndRegisterLayers
public void createAndRegisterLayers(MacroscopicNetworkLayerConfigurator layerConfiguration)
Tries to initialise and create/register layers via a predefined configuration rather than letting the user do this manually via the infrastructure layers container. Only possible when the network is still empty and no layers are yet active- Parameters:
layerConfiguration
- to use for configuration
-
createSimpleGrid
public static MacroscopicNetwork createSimpleGrid(IdGroupingToken tokenId, int rows, int columns)
Create a macroscopic network instance using the id token provided and in addition generate a simple grid-based network layer for the predefined car mode, where each link is bi-directional and has a single link segment type with access for car (nothing else set). For a more sophisticated grid generator configure the dedicated generator class MacroscopicGridNetworkLayerGenerator by overriding its defaults that are used here.- Parameters:
tokenId
- to userows
- in the gridcolumns
- in the grid- Returns:
- created grid network
-
shallowClone
public MacroscopicNetwork shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classUntypedPhysicalNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
- Returns:
- shallow copy of entity
-
deepClone
public MacroscopicNetwork deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classUntypedPhysicalNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
- Returns:
- deep copy of entity
-
-