ID
- The type of ID, e.g., String or Integerpublic class LaneBasedTemplateCar<ID> extends AbstractLaneBasedTemplateGTU<ID>
Copyright (c) 2013-2014 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<ID>
Build a template car and use easy setter methods to instantiate the car.
|
odometer
Constructor and Description |
---|
LaneBasedTemplateCar(ID id,
TemplateGTUType<?> templateGtuType,
GTUFollowingModel gtuFollowingModel,
Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions,
DoubleScalar.Abs<SpeedUnit> initialSpeed,
Route route) |
LaneBasedTemplateCar(ID id,
TemplateGTUType<?> templateGtuType,
GTUFollowingModel gtuFollowingModel,
Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions,
DoubleScalar.Abs<SpeedUnit> initialSpeed,
Route route,
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
addFrontToSubsequentLane, addLane, deltaTimeForDistance, fractionalPosition, fractionalPosition, fractionalPositions, fractionalPositions, getAcceleration, getAcceleration, getBounds, getGTUFollowingModel, getLaneChangeDistanceAndDirection, getLanes, getLastEvaluationTime, getLateralVelocity, getLocation, getLongitudinalVelocity, getLongitudinalVelocity, getNextEvaluationTime, getOdometer, getVelocity, headway, headway, move, parallel, parallel, position, position, positions, positions, projectedPosition, removeLane, timeAtDistance, toString
getId, getReference, getRoute, setRoute
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getReference
public LaneBasedTemplateCar(ID id, TemplateGTUType<?> templateGtuType, GTUFollowingModel gtuFollowingModel, Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions, DoubleScalar.Abs<SpeedUnit> initialSpeed, Route route) throws NamingException, RemoteException, NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException, GTUException
id
- ID; the id of the GTU, could be String or IntegertemplateGtuType
- 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 laneroute
- 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(ID id, TemplateGTUType<?> templateGtuType, GTUFollowingModel gtuFollowingModel, Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions, DoubleScalar.Abs<SpeedUnit> initialSpeed, Route route, 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 GTU, could be String or IntegertemplateGtuType
- 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 laneroute
- 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()
Copyright © 2014–2015 Delft University of Technology. All rights reserved.