Package org.goplanit.zoning
Class Zoning
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Zoning>
-
- org.goplanit.zoning.Zoning
-
- All Implemented Interfaces:
Serializable
,Cloneable
,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 Summary
Fields Modifier and Type Field Description UndirectedConnectoids
odConnectoids
provide access to undirected connectoids (of od zones)OdZones
odZones
provide access to zonesDirectedConnectoids
transferConnectoids
provide access to directed connectoids (of transfer zones)TransferZoneGroups
transferZoneGroups
provide access to transfer zone groups (if any)TransferZones
transferZones
provide access to transfer zones (if any)protected VirtualNetwork
virtualNetwork
Virtual network holds all the virtual connections to the physical network (layers)protected 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.
-
Constructor Summary
Constructors Constructor Description Zoning(IdGroupingToken groupId, IdGroupingToken networkGroupId)
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)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Zoning
clone()
Create a shallow copy of this entitylong
getNumberOfCentroids()
collect the number of centroids across all zones (od and transfer zones)long
getNumberOfConnectoids()
collect the number of connectoids (od and transfer)OdZones
getOdZones()
Access to the odZones containerTransferZones
getTransferZones()
Access to the odZones containerVirtualNetwork
getVirtualNetwork()
Get the virtual network for this zoningZone
getZone(long id)
find a zone by over arching id regardless if it is a transfer or Od zoneZoningModifier
getZoningModifier()
The zoning's modifier instanceboolean
isCompatibleWithDemands(Demands demands, Modes modes)
Verify if passed in demands are compatible with the zoning structure.void
logInfo(String prefix)
Log general information on this zoning to the uservoid
reset()
All components should be able to reset going back to some representative initial state-
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
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
hasExternalId, hasXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Field Detail
-
virtualNetwork
protected final VirtualNetwork virtualNetwork
Virtual network holds all the virtual connections to the physical network (layers)
-
zoningModifier
protected 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
-
odConnectoids
public final UndirectedConnectoids odConnectoids
provide access to undirected connectoids (of od zones)
-
transferConnectoids
public final DirectedConnectoids transferConnectoids
provide access to directed connectoids (of transfer zones)
-
odZones
public final OdZones odZones
provide access to zones
-
transferZones
public final TransferZones transferZones
provide access to transfer zones (if any)
-
transferZoneGroups
public final TransferZoneGroups transferZoneGroups
provide access to transfer zone groups (if any)
-
-
Constructor Detail
-
Zoning
public Zoning(IdGroupingToken groupId, IdGroupingToken networkGroupId)
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 classnetworkGroupId
- contiguous id generation for all instances created by the virtual network
-
Zoning
public Zoning(Zoning other)
Copy constructor- Parameters:
other
- to copy
-
-
Method Detail
-
logInfo
public void logInfo(String prefix)
Log general information on this zoning to the user- Parameters:
prefix
- to use
-
getVirtualNetwork
public VirtualNetwork getVirtualNetwork()
Get the virtual network for this zoning- Returns:
- the virtual network for this zoning
-
isCompatibleWithDemands
public 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 againstmodes
- to check- Returns:
- true when compatible, false otherwise
-
getZone
public 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)
-
getOdZones
public OdZones getOdZones()
Access to the odZones container- Returns:
- odZones
-
getTransferZones
public TransferZones getTransferZones()
Access to the odZones container- Returns:
- odZones
-
getNumberOfCentroids
public long getNumberOfCentroids()
collect the number of centroids across all zones (od and transfer zones)- Returns:
- total number of centroids
-
getNumberOfConnectoids
public long getNumberOfConnectoids()
collect the number of connectoids (od and transfer)- Returns:
- total number of connectoids
-
getZoningModifier
public ZoningModifier getZoningModifier()
The zoning's modifier instance- Returns:
- the zoning modifier
-
clone
public Zoning clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceIdAble
- Specified by:
clone
in classPlanitComponent<Zoning>
- Returns:
- shallow copy of entity
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
reset
in classPlanitComponent<Zoning>
-
-