Package org.opentrafficsim.road.gtu.lane
Class LaneBasedIndividualGTU
java.lang.Object
org.djutils.event.EventProducer
org.opentrafficsim.core.gtu.AbstractGTU
org.opentrafficsim.road.gtu.lane.AbstractLaneBasedGTU2
org.opentrafficsim.road.gtu.lane.AbstractLaneBasedIndividualGTU
org.opentrafficsim.road.gtu.lane.LaneBasedIndividualGTU
- All Implemented Interfaces:
java.io.Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
,GTU
,LaneBasedGTU
public class LaneBasedIndividualGTU extends AbstractLaneBasedIndividualGTU
Augments the AbstractLaneBasedIndividualGTU with a LaneBasedIndividualCarBuilder and animation support
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $,
initial version Oct 22, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LaneBasedIndividualGTU.LaneBasedIndividualCarBuilder
Build an individual car and use easy setter methods to instantiate the car. -
Field Summary
Fields inherited from class org.opentrafficsim.road.gtu.lane.AbstractLaneBasedGTU2
CACHED_POSITION, CACHING, eventMargin, initialLocationThresholdDifference, NON_CACHED_POSITION
Fields inherited from class org.opentrafficsim.core.gtu.AbstractGTU
ALIGN_COUNT, ALIGNED, operationalPlan
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
Fields inherited from interface org.opentrafficsim.core.gtu.GTU
DESTROY_EVENT, INIT_EVENT, MOVE_EVENT
Fields inherited from interface org.opentrafficsim.road.gtu.lane.LaneBasedGTU
LANE_CHANGE_EVENT, LANE_ENTER_EVENT, LANE_EXIT_EVENT, LANEBASED_DESTROY_EVENT, LANEBASED_INIT_EVENT, LANEBASED_MOVE_EVENT, LINK_ENTER_EVENT, LINK_EXIT_EVENT
-
Constructor Summary
Constructors Constructor Description LaneBasedIndividualGTU(java.lang.String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, Length front, Length centerOfGravity, OTSSimulatorInterface simulator, OTSRoadNetwork network)
Construct a new LaneBasedIndividualGTU.LaneBasedIndividualGTU(java.lang.String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, Length front, OTSSimulatorInterface simulator, OTSRoadNetwork network)
Construct a new LaneBasedIndividualGTU. -
Method Summary
Modifier and Type Method Description RelativePosition
getCenter()
ImmutableSet<RelativePosition>
getContourPoints()
RelativePosition
getFront()
RelativePosition
getRear()
ImmutableMap<RelativePosition.TYPE,RelativePosition>
getRelativePositions()
java.lang.String
toString()
Methods inherited from class org.opentrafficsim.road.gtu.lane.AbstractLaneBasedIndividualGTU
getLength, getMaximumSpeed, getWidth, laneChangeAllowed, setNoLaneChangeDistance
Methods inherited from class org.opentrafficsim.road.gtu.lane.AbstractLaneBasedGTU2
addTrigger, changeLaneInstantaneously, destroy, enterCrossSection, finalizeLaneChange, fractionalPosition, fractionalPosition, fractionalPositions, fractionalPositions, getBounds, getCarFollowingAcceleration, getDesiredSpeed, getDirection, getLateralPosition, getNetwork, getReferencePosition, getStrategicalPlanner, getStrategicalPlanner, getTurnIndicatorStatus, getTurnIndicatorStatus, getVehicleModel, init, initLaneChange, isInstantaneousLaneChange, leaveCrossSection, move, position, position, positions, positions, reinit, scheduleEnterEvent, scheduleLeaveEvent, scheduleTriggers, setFinalizeLaneChangeEvent, setInstantaneousLaneChange, setParent, setTurnIndicatorStatus, setVehicleModel
Methods inherited from class org.opentrafficsim.core.gtu.AbstractGTU
addGtu, equals, getAcceleration, getAcceleration, getChildren, getErrorHandler, getGTUType, getId, getLocation, getMaximumAcceleration, getMaximumDeceleration, getNextMoveEvent, getOdometer, getOdometer, getOperationalPlan, getOperationalPlan, getParameters, getParent, getPerceivableContext, getReference, getSimulator, getSourceId, getSpeed, getSpeed, hashCode, init, interruptMove, isDestroyed, removeGtu, setErrorHandler, setMaximumAcceleration, setMaximumDeceleration, setParameters
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, getSourceId, hasListeners, numberOfListeners, removeListener
Methods inherited from interface org.opentrafficsim.core.gtu.GTU
addGtu, getAcceleration, getAcceleration, getChildren, getGTUType, getId, getMaximumAcceleration, getMaximumDeceleration, getOdometer, getOdometer, getOperationalPlan, getOperationalPlan, getParameters, getParent, getPerceivableContext, getReference, getSimulator, getSpeed, getSpeed, isDestroyed, removeGtu, setErrorHandler, setParameters
Methods inherited from interface org.opentrafficsim.road.gtu.lane.LaneBasedGTU
getLocation, getProjectedLength, getTacticalPlanner, getTacticalPlanner, isBrakingLightsOn, isBrakingLightsOn
-
Constructor Details
-
LaneBasedIndividualGTU
public LaneBasedIndividualGTU(java.lang.String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, Length front, OTSSimulatorInterface simulator, OTSRoadNetwork network) throws GTUExceptionConstruct a new LaneBasedIndividualGTU.- Parameters:
id
- String; the id of the GTUgtuType
- GTUType; the type of GTU, e.g. TruckType, CarType, BusTypelength
- Length; the maximum length of the GTU (parallel with driving direction)width
- Length; the maximum width of the GTU (perpendicular to driving direction)maximumSpeed
- Speed;the maximum speed of the GTU (in the driving direction)front
- Length; front distance relative to the reference positionsimulator
- OTSSimulatorInterface; the simulatornetwork
- OTSRoadNetwork; the network that the GTU is initially registered in- Throws:
GTUException
- when a parameter is invalid
-
LaneBasedIndividualGTU
public LaneBasedIndividualGTU(java.lang.String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, Length front, Length centerOfGravity, OTSSimulatorInterface simulator, OTSRoadNetwork network) throws GTUExceptionConstruct a new LaneBasedIndividualGTU.- Parameters:
id
- String; the id of the GTUgtuType
- GTUType; the type of GTU, e.g. TruckType, CarType, BusTypelength
- Length; the maximum length of the GTU (parallel with driving direction)width
- Length; the maximum width of the GTU (perpendicular to driving direction)maximumSpeed
- Speed;the maximum speed of the GTU (in the driving direction)front
- Length; front distance relative to the reference positioncenterOfGravity
- Length; distance from the center of gravity to the reference positionsimulator
- OTSSimulatorInterface; the simulatornetwork
- OTSRoadNetwork; the network that the GTU is initially registered in- Throws:
GTUException
- when a parameter is invalid
-
-
Method Details
-
getFront
-
getRear
-
getCenter
-
getRelativePositions
-
getContourPoints
-
toString
public final java.lang.String toString()- Overrides:
toString
in classAbstractLaneBasedGTU2
-