Class StochasticDistractionModel

    • Constructor Detail

      • StochasticDistractionModel

        public StochasticDistractionModel​(boolean allowMultiTasking,
                                          java.util.List<Distraction> distractions,
                                          DEVSSimulatorInterface.TimeDoubleUnit simulator,
                                          OTSRoadNetwork network)
        Constructor. This model will react to GTU's being created in simulation and apply distractions.
        Parameters:
        allowMultiTasking - boolean; whether to allow multi-tasking
        distractions - List<Distraction>; list of distractions
        simulator - DEVSSimulatorInterface.TimeDoubleUnit; simulator
        network - OTSRoadNetwork; network
    • Method Detail

      • startDistraction

        public void startDistraction​(LaneBasedGTU gtu,
                                     Distraction distraction,
                                     boolean scheduleNext)
                              throws SimRuntimeException
        Start a distraction.
        Parameters:
        gtu - LaneBasedGTU; gtu to start the distraction on
        distraction - Distraction; distraction
        scheduleNext - boolean; whether to schedule the next distraction (not if starting from queue)
        Throws:
        SimRuntimeException - on time error