public class LaneBasedTemplateCar extends AbstractLaneBasedTemplateGTU
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.
Modifier and Type | Class and Description |
---|---|
static class |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder
Build a template car and use easy setter methods to instantiate the car.
|
Constructor and Description |
---|
LaneBasedTemplateCar(String id,
TemplateGTUType templateGtuType,
GTUFollowingModel gtuFollowingModel,
Map<Lane,org.djunits.value.vdouble.scalar.DoubleScalar.Rel<org.djunits.unit.LengthUnit>> initialLongitudinalPositions,
org.djunits.value.vdouble.scalar.DoubleScalar.Abs<org.djunits.unit.SpeedUnit> initialSpeed,
CompleteLaneBasedRouteNavigator routeNavigator) |
LaneBasedTemplateCar(String id,
TemplateGTUType templateGtuType,
GTUFollowingModel gtuFollowingModel,
Map<Lane,org.djunits.value.vdouble.scalar.DoubleScalar.Rel<org.djunits.unit.LengthUnit>> initialLongitudinalPositions,
org.djunits.value.vdouble.scalar.DoubleScalar.Abs<org.djunits.unit.SpeedUnit> initialSpeed,
CompleteLaneBasedRouteNavigator routeNavigator,
Class<? extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D> animationClass) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
destroy the vehicle from the simulation and animation.
|
RelativePosition |
getFront() |
RelativePosition |
getRear() |
Map<RelativePosition.TYPE,RelativePosition> |
getRelativePositions() |
String |
toString() |
getGTUType, getLength, getMaximumVelocity, getSimulator, getWidth
bestAccessibleAdjacentLane, deltaTimeForDistance, enterLane, fractionalPosition, fractionalPosition, fractionalPositions, fractionalPositions, getAcceleration, getAcceleration, getBounds, getGTUFollowingModel, getLaneChangeDistanceAndDirection, getLanes, getLastEvaluationTime, getLateralVelocity, getLocation, getLongitudinalVelocity, getLongitudinalVelocity, getNextEvaluationTime, getOdometer, getVelocity, headway, headway, leaveLane, leaveLane, move, parallel, parallel, position, position, positions, positions, projectedPosition, timeAtDistance, toString
getId, getReference, getRouteNavigator, setRouteNavigator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getReference
public LaneBasedTemplateCar(String id, TemplateGTUType templateGtuType, GTUFollowingModel gtuFollowingModel, Map<Lane,org.djunits.value.vdouble.scalar.DoubleScalar.Rel<org.djunits.unit.LengthUnit>> initialLongitudinalPositions, org.djunits.value.vdouble.scalar.DoubleScalar.Abs<org.djunits.unit.SpeedUnit> initialSpeed, CompleteLaneBasedRouteNavigator routeNavigator) throws NamingException, RemoteException, NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException, GTUException
id
- ID; the id of the GTUtemplateGtuType
- the template of the GTUgtuFollowingModel
- GTUFollowingModel; the following model, including a reference to the simulatorinitialLongitudinalPositions
- Map<Lane, DoubleScalar.Rel<LengthUnit>>; the initial positions of the car
on one or more lanesinitialSpeed
- DoubleScalar.Abs<SpeedUnit>; the initial speed of the car on the lanerouteNavigator
- Route of the GTUNamingException
- if an error occurs when adding the animation handler.RemoteException
- when the simulator cannot be reached.NetworkException
- when the GTU cannot be placed on the given lane.nl.tudelft.simulation.dsol.SimRuntimeException
- when the move method cannot be scheduled.GTUException
- when gtuFollowingModel is nullpublic LaneBasedTemplateCar(String id, TemplateGTUType templateGtuType, GTUFollowingModel gtuFollowingModel, Map<Lane,org.djunits.value.vdouble.scalar.DoubleScalar.Rel<org.djunits.unit.LengthUnit>> initialLongitudinalPositions, org.djunits.value.vdouble.scalar.DoubleScalar.Abs<org.djunits.unit.SpeedUnit> initialSpeed, CompleteLaneBasedRouteNavigator routeNavigator, Class<? extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D> animationClass) throws NamingException, RemoteException, NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException, GTUException
id
- ID; the id of the GTUtemplateGtuType
- the template of the GTUgtuFollowingModel
- GTUFollowingModel; the following model, including a reference to the simulatorinitialLongitudinalPositions
- Map<Lane, DoubleScalar.Rel<LengthUnit>>; the initial positions of the car
on one or more lanesinitialSpeed
- DoubleScalar.Abs<SpeedUnit>; the initial speed of the car on the lanerouteNavigator
- Route; the route of the new caranimationClass
- Class<? extends Renderable2D>; the class for animation or null if no animation.NamingException
- if an error occurs when adding the animation handler.RemoteException
- when the simulator cannot be reached.NetworkException
- when the GTU cannot be placed on the given lane.nl.tudelft.simulation.dsol.SimRuntimeException
- when the move method cannot be scheduled.GTUException
- when gtuFollowingModel is nullpublic RelativePosition getFront()
public RelativePosition getRear()
public final Map<RelativePosition.TYPE,RelativePosition> getRelativePositions()
public final void destroy()
destroy
in interface GTU
destroy
in class AbstractLaneBasedGTU
Copyright © 2014–2015 Delft University of Technology. All rights reserved.