Class 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 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,
                                                        EdgeSegment brokenEdgeSegment)
        perform the actual update of the connectoids based on the broken edge segment
        Parameters:
        vertex - we broke at
        brokenEdgeSegment - 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 interface EventListener
        Returns:
        the supported event types