ID
- the ID type of the Car, e.g. String or Integer or Long.public static class LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> extends Object
LaneBasedTemplateCarcar = new LaneBasedTemplateCarBuilder ().setId("Car:"+nr) .setInitialSpeed(new DoubleScalar.Rel (80.0, LengthUnit.KM_PER_HOUR))....build(); or LaneBasedTemplateCarBuilder carBuilder = new LaneBasedTemplateCarBuilder (); carBuilder.setId("Car:"+nr); carBuilder.setTemplateGtuType(TruckTemplate); carBuilder.setInitialSpeed(new DoubleScalar.Rel (80.0, LengthUnit.KM_PER_HOUR)); ... LaneBasedTemplateCar car = carBuilder.build();
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.
Constructor and Description |
---|
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder() |
Modifier and Type | Method and Description |
---|---|
LaneBasedTemplateCar<ID> |
build() |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> |
setAnimationClass(Class<? extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D> animationClass) |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> |
setId(ID id) |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> |
setInitialLongitudinalPositions(Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions) |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> |
setInitialSpeed(DoubleScalar.Abs<SpeedUnit> initialSpeed) |
LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> |
setTemplateGtuType(TemplateGTUType<?> templateGtuType) |
public LaneBasedTemplateCar.LaneBasedTemplateCarBuilder()
public final LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> setId(ID id)
id
- set id.public final LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> setTemplateGtuType(TemplateGTUType<?> templateGtuType)
templateGtuType
- set the template for the gtuType.public final LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> setInitialLongitudinalPositions(Map<Lane,DoubleScalar.Rel<LengthUnit>> initialLongitudinalPositions)
initialLongitudinalPositions
- set initialLongitudinalPositions.public final LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> setInitialSpeed(DoubleScalar.Abs<SpeedUnit> initialSpeed)
initialSpeed
- set initialSpeed.public final LaneBasedTemplateCar.LaneBasedTemplateCarBuilder<ID> setAnimationClass(Class<? extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D> animationClass)
animationClass
- set animation class.public final LaneBasedTemplateCar<ID> build() throws RemoteException, NamingException, NetworkException, nl.tudelft.simulation.dsol.SimRuntimeException
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.Copyright © 2014–2015 Delft University of Technology. All rights reserved.