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 Summary
Constructors Constructor Description StochasticDistractionModel(boolean allowMultiTasking, java.util.List<Distraction> distractions, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSRoadNetwork network)Constructor. - 
Method Summary
Modifier and Type Method Description voidnotify(nl.tudelft.simulation.event.EventInterface event)voidstartDistraction(LaneBasedGTU gtu, Distraction distraction, boolean scheduleNext)Start a distraction.voidstopDistraction(LaneBasedGTU gtu, Task task)Stops a distraction task. 
- 
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-taskingdistractions- List<Distraction>; list of distractionssimulator- DEVSSimulatorInterface.TimeDoubleUnit; simulatornetwork- OTSRoadNetwork; network
 
 - 
 - 
Method Details
- 
startDistraction
public void startDistraction(LaneBasedGTU gtu, Distraction distraction, boolean scheduleNext) throws SimRuntimeExceptionStart a distraction.- Parameters:
 gtu- LaneBasedGTU; gtu to start the distraction ondistraction- Distraction; distractionscheduleNext- boolean; whether to schedule the next distraction (not if starting from queue)- Throws:
 SimRuntimeException- on time error
 - 
stopDistraction
Stops a distraction task.- Parameters:
 gtu- LaneBasedGTU; gtu to stop the task fortask- 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:
 notifyin interfacenl.tudelft.simulation.event.EventListenerInterface- Throws:
 java.rmi.RemoteException
 
 -