Class UpdateDirectedConnectoidsOnBreakLinkSegmentHandler
- java.lang.Object
-
- org.goplanit.zoning.modifier.event.handler.UpdateDirectedConnectoidsOnBreakLinkSegmentHandler
-
- All Implemented Interfaces:
EventListener
,EventListener
,DirectedGraphModifierListener
,GraphModifierListener
public class UpdateDirectedConnectoidsOnBreakLinkSegmentHandler extends Object implements DirectedGraphModifierListener
Whenever links are broken and these link are references by connectoids, it is possible we must update the access vertex/link segment of this connectoid. This is what this class ensures by listening to break edge segment events and taking action accordingly absed on the provided connectoids if they are affected. Class specifically designed to be used in tandem with breakLinksWithInternalNode. Make sure you identify original downstream vertices of the access link segments for the directed connectoids that could be affected by any break link action on the network. After a break link action this might no be the downstream vertex of the registered access link segments because of the break link action. If changed (due to break links conducted) then we assume the access link segment has been split in two where the original is not closest to the vertex anymore, but the farthest. Hence, we look one link segment downstream and identify if we can match to the desired vertex. If so, we replace the access link segment, if not we let the user know something strange has happened.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description UpdateDirectedConnectoidsOnBreakLinkSegmentHandler(Map<org.locationtech.jts.geom.Point,DirectedConnectoid> connectoidsAccessNodeLocationBeforeBreakLink)
Constructor taking information regarding the access link segment downstream vertex that the connectoid is attached to before any breaking of links.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventType[]
getKnownSupportedEventTypes()
Collect explicitly supported event types that are known.void
onDirectedGraphModificationEvent(DirectedGraphModificationEvent event)
Notify method for directed graph modification eventsvoid
onGraphModificationEvent(GraphModificationEvent event)
Notify method for graph modification eventsprotected void
updateConnectedAccessLinkSegment(DirectedVertex vertex, LinkSegment brokenEdgeSegment)
perform the actual update of the connectoids based on the broken edge segment-
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.event.EventListener
hasKnownSupportedEventTypes
-
-
-
-
Constructor Detail
-
UpdateDirectedConnectoidsOnBreakLinkSegmentHandler
public UpdateDirectedConnectoidsOnBreakLinkSegmentHandler(Map<org.locationtech.jts.geom.Point,DirectedConnectoid> connectoidsAccessNodeLocationBeforeBreakLink)
Constructor taking information regarding the access link segment downstream vertex that the connectoid is attached to before any breaking of links. This will be used to update the connectoid to this same location after the break link in case this has been compromised- Parameters:
connectoidsAccessNodeLocationBeforeBreakLink
- to consider
-
-
Method Detail
-
updateConnectedAccessLinkSegment
protected void updateConnectedAccessLinkSegment(DirectedVertex vertex, LinkSegment brokenEdgeSegment)
perform the actual update of the connectoids based on the broken edge segment- Parameters:
vertex
- we broke atbrokenEdgeSegment
- that is now broken based on vertex
-
getKnownSupportedEventTypes
public EventType[] getKnownSupportedEventTypes()
Collect explicitly supported event types that are known. When not defined the user has to explicitly provide them upon registering the listener on an event producer, otherwise they can be extracted from here- Specified by:
getKnownSupportedEventTypes
in interfaceEventListener
- Returns:
- the supported event types
-
onGraphModificationEvent
public void onGraphModificationEvent(GraphModificationEvent event)
Notify method for graph modification events- Specified by:
onGraphModificationEvent
in interfaceGraphModifierListener
- Parameters:
event
- representing the graph modification event at hand
-
onDirectedGraphModificationEvent
public void onDirectedGraphModificationEvent(DirectedGraphModificationEvent event)
Notify method for directed graph modification events- Specified by:
onDirectedGraphModificationEvent
in interfaceDirectedGraphModifierListener
- Parameters:
event
- representing the directed graph modification event at hand
-
-