Class Zoning

    • Field Detail

      • crs

        protected org.opengis.referencing.crs.CoordinateReferenceSystem crs
        the CRS of this zoning
      • virtualNetwork

        protected 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!
      • 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

        protected final UndirectedConnectoids odConnectoids
        provide access to undirected connectoids (of od zones)
      • transferConnectoids

        protected final DirectedConnectoids transferConnectoids
        provide access to directed connectoids (of transfer zones)
      • odZones

        protected final OdZones odZones
        provide access to zones
      • transferZones

        protected final TransferZones transferZones
        provide access to transfer zones (if any)
      • transferZoneGroups

        protected final TransferZoneGroups transferZoneGroups
        provide access to transfer zone groups (if any)
    • Constructor Detail

      • Zoning

        public 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
      • Zoning

        public 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

      • 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 against
        modes - 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 transferZones container
        Returns:
        transferZones
      • getTransferZoneGroups

        public TransferZoneGroups getTransferZoneGroups()
        Access to the transferZoneGroups container
        Returns:
        TranferZoneGroups
      • getOdConnectoids

        public UndirectedConnectoids getOdConnectoids()
        Access to the origin-destination connectoids container
        Returns:
        od connectoids container
      • getTransferConnectoids

        public DirectedConnectoids getTransferConnectoids()
        Access to the transfer connectoids container
        Returns:
        transfer connectoids container
      • 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
      • deepClone

        public Zoning deepClone()
        deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in class PlanitComponent<Zoning>
        Returns:
        deep 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 class PlanitComponent<Zoning>
      • collectSettingsAsKeyValueMap

        public 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:
        collectSettingsAsKeyValueMap in class PlanitComponent<Zoning>
        Returns:
        name-value map of all (user configurable) settings
      • hasOdZones

        public boolean hasOdZones()
        Verify if od zones are present
        Returns:
        true when present, false otherwise
      • hasTransferZones

        public boolean hasTransferZones()
        Verify if transfer zones are present
        Returns:
        true when present, false otherwise
      • hasTransferConnectoids

        public boolean hasTransferConnectoids()
        Verify if transfer connectoids are present
        Returns:
        true when present, false otherwise
      • hasOdConnectoids

        public boolean hasOdConnectoids()
        Verify if transfer connectoids are present
        Returns:
        true when present, false otherwise
      • getCoordinateReferenceSystem

        public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
        The crs used by the zoning
        Returns:
        crs
      • setCoordinateReferenceSystem

        public void setCoordinateReferenceSystem​(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
        Set the crs to use by the zoning
        Parameters:
        crs - to use