Class BushFlowUpdateConsumer<T extends NetworkFlowUpdateData>

  • All Implemented Interfaces:
    Consumer<Bush>
    Direct Known Subclasses:
    BushTurnFlowUpdateConsumer

    public class BushFlowUpdateConsumer<T extends NetworkFlowUpdateData>
    extends Object
    implements Consumer<Bush>
    Base Consumer to apply during bush based network flow update for each origin bush

    Derived implementation can apply different changes to each of the (turn/link) flows on the bushes by

    Author:
    markr
    • Field Detail

      • dataConfig

        protected T extends NetworkFlowUpdateData dataConfig
        data and configuration used for a flow update by derived classes
    • Constructor Detail

      • BushFlowUpdateConsumer

        public BushFlowUpdateConsumer​(T dataConfig)
        Constructor
        Parameters:
        dataConfig - to use
    • Method Detail

      • applyAcceptedTurnFlowUpdate

        protected void applyAcceptedTurnFlowUpdate​(int prevSegmentId,
                                                   EdgeSegment currentSegment,
                                                   double turnAcceptedFlow)
        Register the bush accepted turn flow to the turn if required. Default implementation does nothing but provide a hook for derived classes that do require to do something with turn accepted flows
        Parameters:
        prevSegmentId - of turn
        currentSegment - of turn
        turnAcceptedFlow - sending flow rate of turn
      • accept

        public void accept​(Bush originBush)
        Update(increase) the (network) flows based on the bush at hand as dictated by the data configuration
        Specified by:
        accept in interface Consumer<T extends NetworkFlowUpdateData>