Class StochasticDistractionModel

java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.StochasticDistractionModel
All Implemented Interfaces:
Serializable, Remote, EventListener, org.djutils.event.EventListener

public class StochasticDistractionModel extends Object implements org.djutils.event.EventListener
Stochastic Distraction Model by Manuel Lindorfer.

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

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • StochasticDistractionModel

      public StochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, OtsSimulatorInterface simulator, RoadNetwork 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 - OtsSimulatorInterface; simulator
      network - RoadNetwork; network
  • Method Details

    • startDistraction

      public void startDistraction(LaneBasedGtu gtu, Distraction distraction, boolean scheduleNext) throws nl.tudelft.simulation.dsol.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:
      nl.tudelft.simulation.dsol.SimRuntimeException - on time error
    • stopDistraction

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

      public void notify(org.djutils.event.Event event) throws RemoteException
      Specified by:
      notify in interface org.djutils.event.EventListener
      Throws:
      RemoteException