Class StochasticDistractionModel
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.perception.mental.sdm.StochasticDistractionModel
-
- All Implemented Interfaces:
Serializable
,EventListener
,EventListenerInterface
public class StochasticDistractionModel extends Object implements 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
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSRoadNetwork network)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
notify(EventInterface event)
void
startDistraction(LaneBasedGTU gtu, Distraction distraction, boolean scheduleNext)
Start a distraction.void
stopDistraction(LaneBasedGTU gtu, Task task)
Stops a distraction task.
-
-
-
Constructor Detail
-
StochasticDistractionModel
public StochasticDistractionModel(boolean allowMultiTasking, 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 Detail
-
startDistraction
public void startDistraction(LaneBasedGTU gtu, Distraction distraction, boolean scheduleNext) throws 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:
SimRuntimeException
- on time error
-
stopDistraction
public void stopDistraction(LaneBasedGTU gtu, Task task) throws SimRuntimeException
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(EventInterface event) throws RemoteException
- Specified by:
notify
in interfaceEventListenerInterface
- Throws:
RemoteException
-
-