public class StochasticDistractionModel extends Object implements nl.tudelft.simulation.event.EventListenerInterface
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
StochasticDistractionModel(boolean allowMultiTasking,
List<Distraction> distractions,
nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit simulator,
OTSRoadNetwork network)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
notify(nl.tudelft.simulation.event.EventInterface event) |
void |
startDistraction(LaneBasedGTU gtu,
Distraction distraction,
boolean scheduleNext)
Start a distraction.
|
void |
stopDistraction(LaneBasedGTU gtu,
Task task)
Stops a distraction task.
|
public StochasticDistractionModel(boolean allowMultiTasking, List<Distraction> distractions, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSRoadNetwork network)
allowMultiTasking
- boolean; whether to allow multi-taskingdistractions
- List<Distraction>; list of distractionssimulator
- DEVSSimulatorInterface.TimeDoubleUnit; simulatornetwork
- OTSRoadNetwork; networkpublic void startDistraction(LaneBasedGTU gtu, Distraction distraction, boolean scheduleNext) throws nl.tudelft.simulation.dsol.SimRuntimeException
gtu
- LaneBasedGTU; gtu to start the distraction ondistraction
- Distraction; distractionscheduleNext
- boolean; whether to schedule the next distraction (not if starting from queue)nl.tudelft.simulation.dsol.SimRuntimeException
- on time errorpublic void stopDistraction(LaneBasedGTU gtu, Task task) throws nl.tudelft.simulation.dsol.SimRuntimeException
gtu
- LaneBasedGTU; gtu to stop the task fortask
- Task; task to stopnl.tudelft.simulation.dsol.SimRuntimeException
- on time errorpublic void notify(nl.tudelft.simulation.event.EventInterface event) throws RemoteException
notify
in interface nl.tudelft.simulation.event.EventListenerInterface
RemoteException
Copyright © 2014–2019 Delft University of Technology. All rights reserved.