public abstract class AbstractGTU extends Object implements GTU
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
AbstractGTU(String id,
GTUType gtuType,
OTSDEVSSimulatorInterface simulator,
StrategicalPlanner strategicalPlanner,
Perception perception,
nl.tudelft.simulation.language.d3.DirectedPoint initialLocation,
org.djunits.value.vdouble.scalar.Speed initialSpeed,
PerceivableContext perceivableContext) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destructor.
|
org.djunits.value.vdouble.scalar.Acceleration |
getAcceleration() |
org.djunits.value.vdouble.scalar.Acceleration |
getAcceleration(org.djunits.value.vdouble.scalar.Time.Abs time) |
GTUType |
getGTUType() |
String |
getId() |
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation() |
org.djunits.value.vdouble.scalar.Acceleration |
getMaximumAcceleration() |
org.djunits.value.vdouble.scalar.Acceleration |
getMaximumDeceleration() |
org.djunits.value.vdouble.scalar.Length.Rel |
getOdometer() |
OperationalPlan |
getOperationalPlan() |
Perception |
getPerception() |
RelativePosition |
getReference() |
OTSDEVSSimulatorInterface |
getSimulator() |
StrategicalPlanner |
getStrategicalPlanner() |
TacticalPlanner |
getTacticalPlanner() |
org.djunits.value.vdouble.scalar.Speed |
getVelocity() |
org.djunits.value.vdouble.scalar.Speed |
getVelocity(org.djunits.value.vdouble.scalar.Time.Abs time) |
protected void |
interruptMove()
Interrupt the move and ask for a new plan.
|
protected void |
move(nl.tudelft.simulation.language.d3.DirectedPoint fromLocation)
Move from the current location according to an operational plan to a location that will bring us nearer to reaching the
location provided by the strategical planner.
|
void |
setMaximumAcceleration(org.djunits.value.vdouble.scalar.Acceleration maximumAcceleration) |
void |
setMaximumDeceleration(org.djunits.value.vdouble.scalar.Acceleration maximumDeceleration) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBounds, getDrivingCharacteristics, getFront, getLength, getMaximumVelocity, getRear, getRelativePositions, getWidth
public AbstractGTU(String id, GTUType gtuType, OTSDEVSSimulatorInterface simulator, StrategicalPlanner strategicalPlanner, Perception perception, nl.tudelft.simulation.language.d3.DirectedPoint initialLocation, org.djunits.value.vdouble.scalar.Speed initialSpeed, PerceivableContext perceivableContext) throws nl.tudelft.simulation.dsol.SimRuntimeException, GTUException
id
- the id of the GTUgtuType
- the type of GTU, e.g. TruckType, CarType, BusTypesimulator
- the simulator to schedule plan changes onstrategicalPlanner
- the planner responsible for the overall 'mission' of the GTU, usually indicating where it needs
to go. It operates by instantiating tactical planners to do the work.perception
- the perception unit that takes care of observing the environment of the GTUinitialLocation
- the initial location (and direction) of the GTUinitialSpeed
- the initial speed of the GTUperceivableContext
- the perceivable context in which this GTU will be registerednl.tudelft.simulation.dsol.SimRuntimeException
- when scheduling after the first move failsGTUException
- when the construction of the original waiting path failspublic void destroy()
protected void move(nl.tudelft.simulation.language.d3.DirectedPoint fromLocation) throws nl.tudelft.simulation.dsol.SimRuntimeException, OperationalPlanException, GTUException, NetworkException
fromLocation
- the last known location (initial location, or end location of the previous operational plan)nl.tudelft.simulation.dsol.SimRuntimeException
- when scheduling of the next move failsOperationalPlanException
- when there is a problem creating a good path for the GTUGTUException
- when there is a problem with the state of the GTU when planning a pathNetworkException
- in case of a problem with the network, e.g., a dead end where it is not expectedprotected void interruptMove() throws nl.tudelft.simulation.dsol.SimRuntimeException, OperationalPlanException, GTUException, NetworkException
OperationalPlanException
- when there was a problem retrieving the location from the running plannl.tudelft.simulation.dsol.SimRuntimeException
- when scheduling of the next move failsOperationalPlanException
- when there is a problem creating a good path for the GTUGTUException
- when there is a problem with the state of the GTU when planning a pathNetworkException
- in case of a problem with the network, e.g., unreachability of a certain pointpublic GTUType getGTUType()
getGTUType
in interface GTU
public final RelativePosition getReference()
getReference
in interface GTU
public final OTSDEVSSimulatorInterface getSimulator()
getSimulator
in interface GTU
public StrategicalPlanner getStrategicalPlanner()
getStrategicalPlanner
in interface GTU
public final TacticalPlanner getTacticalPlanner()
getTacticalPlanner
in interface GTU
public final OperationalPlan getOperationalPlan()
getOperationalPlan
in interface GTU
public Perception getPerception()
getPerception
in interface GTU
public final org.djunits.value.vdouble.scalar.Length.Rel getOdometer()
getOdometer
in interface GTU
public final org.djunits.value.vdouble.scalar.Speed getVelocity(org.djunits.value.vdouble.scalar.Time.Abs time)
getVelocity
in interface GTU
time
- the time for which the velocity needs to be calculated.public final org.djunits.value.vdouble.scalar.Speed getVelocity()
getVelocity
in interface GTU
public final org.djunits.value.vdouble.scalar.Acceleration getAcceleration(org.djunits.value.vdouble.scalar.Time.Abs time)
getAcceleration
in interface GTU
time
- the time for which the acceleration needs to be calculated.public final org.djunits.value.vdouble.scalar.Acceleration getMaximumAcceleration()
getMaximumAcceleration
in interface GTU
public final void setMaximumAcceleration(org.djunits.value.vdouble.scalar.Acceleration maximumAcceleration)
maximumAcceleration
- set maximumAccelerationpublic final org.djunits.value.vdouble.scalar.Acceleration getMaximumDeceleration()
getMaximumDeceleration
in interface GTU
public final void setMaximumDeceleration(org.djunits.value.vdouble.scalar.Acceleration maximumDeceleration)
maximumDeceleration
- set maximumDeceleration, stored as a negative numberpublic final org.djunits.value.vdouble.scalar.Acceleration getAcceleration()
getAcceleration
in interface GTU
public nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation
in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
getLocation
in interface GTU
Copyright © 2014–2016 Delft University of Technology. All rights reserved.