Class StochasticDistractionModel
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.StochasticDistractionModel
- All Implemented Interfaces:
EventListener,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 Summary
ConstructorsConstructorDescriptionStochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, RoadNetwork network, Set<GtuType> gtuTypes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstartDistraction(LaneBasedGtu gtu, Distraction distraction, boolean scheduleNext) Start a distraction.voidstopDistraction(LaneBasedGtu gtu, String distractionId) Stops a distraction task.
-
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-taskingdistractions- list of distractionsnetwork- networkgtuTypes- 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 ondistraction- distractionscheduleNext- 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 fordistractionId- distraction id- Throws:
nl.tudelft.simulation.dsol.SimRuntimeException- on time error
-
notify
- Specified by:
notifyin interfaceEventListener
-