Class StochasticDistractionModel

java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.StochasticDistractionModel
All Implemented Interfaces:
java.util.EventListener, nl.tudelft.simulation.event.EventListenerInterface

public class StochasticDistractionModel
extends java.lang.Object
implements nl.tudelft.simulation.event.EventListenerInterface
Stochastic Distraction Model by Manuel Lindorfer.

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 28 jun. 2018
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

    • 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 Details

    • 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
    • stopDistraction

      public void stopDistraction​(LaneBasedGTU gtu, Task task) throws SimRuntimeException
      Stops a distraction task.
      Parameters:
      gtu - LaneBasedGTU; gtu to stop the task for
      task - Task; task to stop
      Throws:
      SimRuntimeException - on time error
    • notify

      public void notify​(nl.tudelft.simulation.event.EventInterface event) throws java.rmi.RemoteException
      Specified by:
      notify in interface nl.tudelft.simulation.event.EventListenerInterface
      Throws:
      java.rmi.RemoteException