Class StochasticDistractionModel

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

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

Copyright (c) 2013-2025 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
  • Constructor Details

    • StochasticDistractionModel

      public StochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, RoadNetwork network, Set<GtuType> gtuTypes)
      Constructor. This model will react to GTU's being created in simulation and apply distractions.
      Parameters:
      allowMultiTasking - whether to allow multi-tasking
      distractions - list of distractions
      network - network
      gtuTypes - GTU types to which the distractions apply
  • Method Details

    • startDistraction

      public void startDistraction(LaneBasedGtu gtu, Distraction distraction, boolean scheduleNext) throws nl.tudelft.simulation.dsol.SimRuntimeException
      Start a distraction.
      Parameters:
      gtu - gtu to start the distraction on
      distraction - distraction
      scheduleNext - 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, String distractionId) throws nl.tudelft.simulation.dsol.SimRuntimeException
      Stops a distraction task.
      Parameters:
      gtu - gtu to stop the task for
      distractionId - distraction id
      Throws:
      nl.tudelft.simulation.dsol.SimRuntimeException - on time error
    • notify

      public void notify(Event event)
      Specified by:
      notify in interface EventListener