Package org.goplanit.zoning
Class Zoning
- java.lang.Object
- 
- org.goplanit.component.PlanitComponent<Zoning>
- 
- org.goplanit.zoning.Zoning
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<IdAble>,- EventListener,- PlanitComponentListener,- EventListener,- ExternalIdAble,- IdAble
 
 public class Zoning extends PlanitComponent<Zoning> implements Serializable Zoning class which holds a particular zoning- Author:
- markr
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected org.opengis.referencing.crs.CoordinateReferenceSystemcrsthe CRS of this zoningprotected UndirectedConnectoidsodConnectoidsprovide access to undirected connectoids (of od zones)protected OdZonesodZonesprovide access to zonesprotected DirectedConnectoidstransferConnectoidsprovide access to directed connectoids (of transfer zones)protected TransferZoneGroupstransferZoneGroupsprovide access to transfer zone groups (if any)protected TransferZonestransferZonesprovide access to transfer zones (if any)protected VirtualNetworkvirtualNetworkVirtual network holds all the virtual connections to the physical network (layers) todo: we should have potentially multiple virtual networks per zoning, one for each physical network the zoning is used on!protected ZoningModifierzoningModifiermodifier that can be used to perform modifications to the zoning that comprise more than a single element of the zoning, e.g.
 - 
Constructor SummaryConstructors Constructor Description Zoning(IdGroupingToken groupId, IdGroupingToken virtualNetworkGroupId)Constructor The second id generation token should be the token used by the physical network to create physical network entities such as links, nodes, etc.Zoning(Zoning other, boolean deepCopy, ManagedIdDeepCopyMapper<UndirectedConnectoid> undirConnectoidMapper, ManagedIdDeepCopyMapper<DirectedConnectoid> dirConnectoidMapper, ManagedIdDeepCopyMapper<OdZone> odZoneMapper, ManagedIdDeepCopyMapper<TransferZone> transferZoneMapper, ManagedIdDeepCopyMapper<TransferZoneGroup> transferZoneGroupMapper)Copy constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>collectSettingsAsKeyValueMap()Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entityZoningdeepClone()deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleorg.opengis.referencing.crs.CoordinateReferenceSystemgetCoordinateReferenceSystem()The crs used by the zoninglonggetNumberOfCentroids()collect the number of centroids across all zones (od and transfer zones)longgetNumberOfConnectoids()collect the number of connectoids (od and transfer)UndirectedConnectoidsgetOdConnectoids()Access to the origin-destination connectoids containerOdZonesgetOdZones()Access to the odZones containerDirectedConnectoidsgetTransferConnectoids()Access to the transfer connectoids containerTransferZoneGroupsgetTransferZoneGroups()Access to the transferZoneGroups containerTransferZonesgetTransferZones()Access to the transferZones containerVirtualNetworkgetVirtualNetwork()Get the virtual network for this zoningZonegetZone(long id)find a zone by over arching id regardless if it is a transfer or Od zoneZoningModifiergetZoningModifier()The zoning's modifier instancebooleanhasOdConnectoids()Verify if transfer connectoids are presentbooleanhasOdZones()Verify if od zones are presentbooleanhasTransferConnectoids()Verify if transfer connectoids are presentbooleanhasTransferZones()Verify if transfer zones are presentbooleanisCompatibleWithDemands(Demands demands, Modes modes)Verify if passed in demands are compatible with the zoning structure.voidlogInfo(String prefix)Log general information on this zoning to the uservoidreset()All components should be able to reset going back to some representative initial statevoidsetCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs)Set the crs to use by the zoningZoningshallowClone()Create a shallow copy of this entity- 
Methods inherited from class org.goplanit.component.PlanitComponentequals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.goplanit.utils.event.EventListenerhasKnownSupportedEventTypes
 - 
Methods inherited from interface org.goplanit.utils.id.ExternalIdAbleappendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
 - 
Methods inherited from interface org.goplanit.utils.id.IdAblecompareTo, idEquals, idHashCode
 
- 
 
- 
- 
- 
Field Detail- 
crsprotected org.opengis.referencing.crs.CoordinateReferenceSystem crs the CRS of this zoning
 - 
virtualNetworkprotected final VirtualNetwork virtualNetwork Virtual network holds all the virtual connections to the physical network (layers) todo: we should have potentially multiple virtual networks per zoning, one for each physical network the zoning is used on!
 - 
zoningModifierprotected final ZoningModifier zoningModifier modifier that can be used to perform modifications to the zoning that comprise more than a single element of the zoning, e.g. updating of ids. It is also used by listeners that are needed to update the zoning components in case the referenced network gets modified
 - 
odConnectoidsprotected final UndirectedConnectoids odConnectoids provide access to undirected connectoids (of od zones)
 - 
transferConnectoidsprotected final DirectedConnectoids transferConnectoids provide access to directed connectoids (of transfer zones)
 - 
odZonesprotected final OdZones odZones provide access to zones
 - 
transferZonesprotected final TransferZones transferZones provide access to transfer zones (if any)
 - 
transferZoneGroupsprotected final TransferZoneGroups transferZoneGroups provide access to transfer zone groups (if any)
 
- 
 - 
Constructor Detail- 
Zoningpublic Zoning(IdGroupingToken groupId, IdGroupingToken virtualNetworkGroupId) Constructor The second id generation token should be the token used by the physical network to create physical network entities such as links, nodes, etc. The virtual network should register connectoids, centroids, etc. with ids compatible under this same network. For example, a centroid is a vertex, like a node, so the vertex ids should be contiguous and unique throughout the combination of the virtual and physical network. Hence, they should use the same network id token- Parameters:
- groupId- contiguous id generation within this group for instances of this class
- virtualNetworkGroupId- contiguous id generation for all instances created by the virtual network
 
 - 
Zoningpublic Zoning(Zoning other, boolean deepCopy, ManagedIdDeepCopyMapper<UndirectedConnectoid> undirConnectoidMapper, ManagedIdDeepCopyMapper<DirectedConnectoid> dirConnectoidMapper, ManagedIdDeepCopyMapper<OdZone> odZoneMapper, ManagedIdDeepCopyMapper<TransferZone> transferZoneMapper, ManagedIdDeepCopyMapper<TransferZoneGroup> transferZoneGroupMapper) Copy constructor- Parameters:
- other- to copy
- deepCopy- when true, create a deep copy, shallow copy otherwise
- undirConnectoidMapper- to use for tracking mapping between original and copied entity (may be null)
- dirConnectoidMapper- to use for tracking mapping between original and copied entity (may be null)
- odZoneMapper- to use for tracking mapping between original and copied entity (may be null)
- transferZoneMapper- to use for tracking mapping between original and copied entity (may be null)
- transferZoneGroupMapper- to use for tracking mapping between original and copied entity (may be null)
 
 
- 
 - 
Method Detail- 
logInfopublic void logInfo(String prefix) Log general information on this zoning to the user- Parameters:
- prefix- to use
 
 - 
getVirtualNetworkpublic VirtualNetwork getVirtualNetwork() Get the virtual network for this zoning- Returns:
- the virtual network for this zoning
 
 - 
isCompatibleWithDemandspublic boolean isCompatibleWithDemands(Demands demands, Modes modes) Verify if passed in demands are compatible with the zoning structure. Compatibility is ensured when the number of zones matches the number of origins/destinations in the demands.- Parameters:
- demands- to verify against
- modes- to check
- Returns:
- true when compatible, false otherwise
 
 - 
getZonepublic Zone getZone(long id) find a zone by over arching id regardless if it is a transfer or Od zone- Parameters:
- id- to find the zone by
- Returns:
- zone found (if any)
 
 - 
getOdZonespublic OdZones getOdZones() Access to the odZones container- Returns:
- odZones
 
 - 
getTransferZonespublic TransferZones getTransferZones() Access to the transferZones container- Returns:
- transferZones
 
 - 
getTransferZoneGroupspublic TransferZoneGroups getTransferZoneGroups() Access to the transferZoneGroups container- Returns:
- TranferZoneGroups
 
 - 
getOdConnectoidspublic UndirectedConnectoids getOdConnectoids() Access to the origin-destination connectoids container- Returns:
- od connectoids container
 
 - 
getTransferConnectoidspublic DirectedConnectoids getTransferConnectoids() Access to the transfer connectoids container- Returns:
- transfer connectoids container
 
 - 
getNumberOfCentroidspublic long getNumberOfCentroids() collect the number of centroids across all zones (od and transfer zones)- Returns:
- total number of centroids
 
 - 
getNumberOfConnectoidspublic long getNumberOfConnectoids() collect the number of connectoids (od and transfer)- Returns:
- total number of connectoids
 
 - 
getZoningModifierpublic ZoningModifier getZoningModifier() The zoning's modifier instance- Returns:
- the zoning modifier
 
 - 
shallowClonepublic Zoning shallowClone() Create a shallow copy of this entity- Specified by:
- shallowClonein interface- IdAble
- Specified by:
- shallowClonein class- PlanitComponent<Zoning>
- Returns:
- shallow copy of entity
 
 - 
deepClonepublic Zoning deepClone() deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
- deepClonein interface- IdAble
- Specified by:
- deepClonein class- PlanitComponent<Zoning>
- Returns:
- deep copy of entity
 
 - 
resetpublic void reset() All components should be able to reset going back to some representative initial state- Specified by:
- resetin class- PlanitComponent<Zoning>
 
 - 
collectSettingsAsKeyValueMappublic Map<String,String> collectSettingsAsKeyValueMap() Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity- Specified by:
- collectSettingsAsKeyValueMapin class- PlanitComponent<Zoning>
- Returns:
- name-value map of all (user configurable) settings
 
 - 
hasOdZonespublic boolean hasOdZones() Verify if od zones are present- Returns:
- true when present, false otherwise
 
 - 
hasTransferZonespublic boolean hasTransferZones() Verify if transfer zones are present- Returns:
- true when present, false otherwise
 
 - 
hasTransferConnectoidspublic boolean hasTransferConnectoids() Verify if transfer connectoids are present- Returns:
- true when present, false otherwise
 
 - 
hasOdConnectoidspublic boolean hasOdConnectoids() Verify if transfer connectoids are present- Returns:
- true when present, false otherwise
 
 - 
getCoordinateReferenceSystempublic org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem() The crs used by the zoning- Returns:
- crs
 
 - 
setCoordinateReferenceSystempublic void setCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Set the crs to use by the zoning- Parameters:
- crs- to use
 
 
- 
 
-