Class StochasticDistractionModel
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.mental.sdm.StochasticDistractionModel
- All Implemented Interfaces:
Serializable,Remote,EventListener,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 Summary
ConstructorsConstructorDescriptionStochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, OtsSimulatorInterface simulator, RoadNetwork network) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidnotify(org.djutils.event.Event 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, 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-taskingdistractions- List<Distraction>; list of distractionssimulator- OtsSimulatorInterface; simulatornetwork- 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 ondistraction- Distraction; distractionscheduleNext- 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 fortask- Task; task to stop- Throws:
nl.tudelft.simulation.dsol.SimRuntimeException- on time error
-
notify
- Specified by:
notifyin interfaceorg.djutils.event.EventListener- Throws:
RemoteException
-