Package org.opentrafficsim.road.gtu.lane
Class AbstractLaneBasedIndividualGTU
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.core.gtu.AbstractGTU
-
- org.opentrafficsim.road.gtu.lane.AbstractLaneBasedGTU2
-
- org.opentrafficsim.road.gtu.lane.AbstractLaneBasedIndividualGTU
-
- All Implemented Interfaces:
Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
,GTU
,LaneBasedGTU
- Direct Known Subclasses:
LaneBasedIndividualGTU
public abstract class AbstractLaneBasedIndividualGTU extends AbstractLaneBasedGTU2
Specific type of LaneBasedGTU. This class adds length, width, maximum speed and a reference to the simulator to the AbstractLaneBasedGTU.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 Jan 1, 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
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 class org.djutils.event.EventProducer
eventProducerImpl
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractLaneBasedIndividualGTU(String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, OTSSimulatorInterface simulator, OTSRoadNetwork network)
Construct a new AbstractLaneBasedIndividualGTU.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Length
getLength()
Speed
getMaximumSpeed()
Length
getWidth()
boolean
laneChangeAllowed()
Returns whether a lane change is allowed.void
setNoLaneChangeDistance(Length distance)
Set distance over which the GTU should not change lane after being created.-
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, toString
-
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, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, 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, getCenter, getChildren, getContourPoints, getFront, getGTUType, getId, getMaximumAcceleration, getMaximumDeceleration, getOdometer, getOdometer, getOperationalPlan, getOperationalPlan, getParameters, getParent, getPerceivableContext, getRear, getReference, getRelativePositions, getSimulator, getSpeed, getSpeed, isDestroyed, removeGtu, setErrorHandler, setParameters
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.LaneBasedGTU
getLocation, getProjectedLength, getTacticalPlanner, getTacticalPlanner, isBrakingLightsOn, isBrakingLightsOn
-
-
-
-
Constructor Detail
-
AbstractLaneBasedIndividualGTU
public AbstractLaneBasedIndividualGTU(String id, GTUType gtuType, Length length, Length width, Speed maximumSpeed, OTSSimulatorInterface simulator, OTSRoadNetwork network) throws GTUException
Construct a new AbstractLaneBasedIndividualGTU.- 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)simulator
- OTSSimulatorInterface; the simulatornetwork
- OTSRoadNetwork; the network that the GTU is initially registered in- Throws:
GTUException
- when a parameter is invalid
-
-
Method Detail
-
getLength
public final Length getLength()
-
getWidth
public final Length getWidth()
-
getMaximumSpeed
public final Speed getMaximumSpeed()
-
setNoLaneChangeDistance
public final void setNoLaneChangeDistance(Length distance)
Set distance over which the GTU should not change lane after being created.- Parameters:
distance
- Length; distance over which the GTU should not change lane after being created
-
laneChangeAllowed
public final boolean laneChangeAllowed()
Returns whether a lane change is allowed.- Returns:
- whether a lane change is allowed
-
-