Class ServiceNetworkLayerModifierImpl<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment>
- java.lang.Object
-
- org.goplanit.network.layer.modifier.UntypedNetworkLayerModifierImpl<V,E,S>
-
- org.goplanit.network.layer.modifier.ServiceNetworkLayerModifierImpl<V,E,S>
-
- All Implemented Interfaces:
EventProducer
,GraphModifierEventProducer
,TopologicalModifier
,ServiceNetworkLayerModifier<V,E,S>
,TopologicalLayerModifier
,UntypedDirectedGraphLayerModifier<V,E,S>
public class ServiceNetworkLayerModifierImpl<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment> extends UntypedNetworkLayerModifierImpl<V,E,S> implements ServiceNetworkLayerModifier<V,E,S>
Modifier class for service network layer, added functionality for service networks to:- remove unmapped service nodes, service legs, and service leg segments
- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.network.layer.modifier.UntypedNetworkLayerModifierImpl
graphModifier
-
-
Constructor Summary
Constructors Constructor Description ServiceNetworkLayerModifierImpl(ServiceNetworkLayerImpl serviceNetworkLayer, UntypedDirectedGraphImpl<V,E,S> graph)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Long,Pair<E,E>>
breakAt(List<E> serviceLegsToBreak, V serviceNodeToBreakAt, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
todo: implement by breaking service leg + update underlying physical link segments by assigning them to either part of broken service legvoid
removeDanglingSubnetworks(Integer belowSize, Integer aboveSize, boolean alwaysKeepLargest)
todo: implement by removing dangling service network subnetworks.void
removeUnmappedServiceNetworkEntities()
Method that will remove all entities (service nodes, legs, leg segments) that have no mapping present to the underlying physical network layer the service network is attached to.-
Methods inherited from class org.goplanit.network.layer.modifier.UntypedNetworkLayerModifierImpl
addListener, addListener, getUntypedDirectedGraph, recreateManagedIdEntities, removeAllListeners, removeListener, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.graph.modifier.event.GraphModifierEventProducer
addListener, addListener, removeAllListeners, removeListener, removeListener
-
Methods inherited from interface org.goplanit.utils.network.layer.modifier.TopologicalLayerModifier
removeDanglingSubnetworks
-
Methods inherited from interface org.goplanit.utils.network.layer.modifier.UntypedDirectedGraphLayerModifier
breakAt, breakAt, recreateManagedIdEntities
-
-
-
-
Constructor Detail
-
ServiceNetworkLayerModifierImpl
public ServiceNetworkLayerModifierImpl(ServiceNetworkLayerImpl serviceNetworkLayer, UntypedDirectedGraphImpl<V,E,S> graph)
Constructor- Parameters:
serviceNetworkLayer
- to usegraph
- parent graph to base modifier on
-
-
Method Detail
-
breakAt
public Map<Long,Pair<E,E>> breakAt(List<E> serviceLegsToBreak, V serviceNodeToBreakAt, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
todo: implement by breaking service leg + update underlying physical link segments by assigning them to either part of broken service leg- Specified by:
breakAt
in interfaceUntypedDirectedGraphLayerModifier<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment>
- Overrides:
breakAt
in classUntypedNetworkLayerModifierImpl<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment>
- Parameters:
serviceLegsToBreak
- the links to breakserviceNodeToBreakAt
- the node to break atcrs
- to use to recompute link lengths of broken links- Returns:
- the broken links for each original link's internal id
-
removeDanglingSubnetworks
public void removeDanglingSubnetworks(Integer belowSize, Integer aboveSize, boolean alwaysKeepLargest)
todo: implement by removing dangling service network subnetworks. But unclear what this means. What if service network is dangling but the underlying physical network is not for now not yet supported. If we implement it in the strict sense, we can simply borrow the functionality from super class and remove override- Specified by:
removeDanglingSubnetworks
in interfaceTopologicalLayerModifier
- Overrides:
removeDanglingSubnetworks
in classUntypedNetworkLayerModifierImpl<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment>
- Parameters:
belowSize
- remove subnetworks below the given sizeaboveSize
- remove subnetworks above the given size (typically set to maximum value)alwaysKeepLargest
- when true the largest of the subnetworks is always kept, otherwise not
-
removeUnmappedServiceNetworkEntities
public void removeUnmappedServiceNetworkEntities()
Method that will remove all entities (service nodes, legs, leg segments) that have no mapping present to the underlying physical network layer the service network is attached to.Note that invoking this method will recreate all managed ids across the service network due to gaps occurring after removal of unmapped entries
Should fire #RecreatedGraphEntitiesManagedIdsEvent after it has been executed
- Specified by:
removeUnmappedServiceNetworkEntities
in interfaceServiceNetworkLayerModifier<V extends ServiceNode,E extends ServiceLeg,S extends ServiceLegSegment>
-
-