Package org.planit.network.virtual
Class Zoning
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.planit.trafficassignment.TrafficAssignmentComponent<Zoning>
-
- org.planit.network.virtual.Zoning
-
- All Implemented Interfaces:
Serializable
,org.djutils.event.EventProducerInterface
public class Zoning extends TrafficAssignmentComponent<Zoning> implements Serializable
Zoning class which holds a particular zoning- Author:
- markr
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Zoning.Zones
Internal class for all zone specific code
-
Field Summary
Fields Modifier and Type Field Description protected VirtualNetwork
virtualNetwork
Virtual network holds all the virtual connections to the physical networkprotected Map<Long,Zone>
zoneMap
Map storing all the zones by their row/column in the OD matrixZoning.Zones
zones
provide access to zones of this zoning-
Fields inherited from class org.planit.trafficassignment.TrafficAssignmentComponent
groupId, id, trafficComponentType
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VirtualNetwork
getVirtualNetwork()
Get the virtual network for this zoningboolean
isCompatibleWithDemands(Demands demands, PhysicalNetwork.Modes modes)
Verify if passed in demands are compatible with the zoning structure.-
Methods inherited from class org.planit.trafficassignment.TrafficAssignmentComponent
getId, getIdGroupingtoken, getSourceId, getTrafficComponentType
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
-
-
-
Field Detail
-
zoneMap
protected final Map<Long,Zone> zoneMap
Map storing all the zones by their row/column in the OD matrix
-
virtualNetwork
protected final VirtualNetwork virtualNetwork
Virtual network holds all the virtual connections to the physical network
-
zones
public final Zoning.Zones zones
provide access to zones of this zoning
-
-
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
-
-
Method Detail
-
getVirtualNetwork
public VirtualNetwork getVirtualNetwork()
Get the virtual network for this zoning- Returns:
- the virtual network for this zoning
-
isCompatibleWithDemands
public boolean isCompatibleWithDemands(Demands demands, PhysicalNetwork.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
-
-