Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadSidePart
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadPart
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Constructor Details
- Method Details
- addSpeedLimitSign
- isSpeedLimitSign
- getSpeedLimit
- addYieldSign
- isYieldSign
- addEndOfSpeedLimitSign
- isEndOfSpeedLimitSign
- averageSpeed
- averageSpeed
- queueSize
- queueSize
- onCarPassed
- postInitialize
- getLaneIndexFrom
- setLaneIndexFrom
- getLaneIndexTo
- setLaneIndexTo
- setSignal
- getSignal
- registerListener
- getLength
- updateDynamicProperties
- All Implemented Interfaces:
AggregatableAnimationElement
,IDescriptor
,HasLevel
,IMarkupLibraryDescriptor
,ISignalable
,IStopLineDescriptor<T>
,SVGElement
,UsdElement
,Serializable
public class StopLine<T extends Agent> extends AbstractRoadSidePart implements ISignalable, IStopLineDescriptor<T>
Markup element that marks a position on one or several lanes on a road. This element is determined by segment that
crosses one or several guidelines within other markup elements.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
StopLine() |
Creates a new position on road.
|
StopLine | |
StopLine |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method | Description |
---|---|---|
void | addEndOfSpeedLimitSign() |
Adds "end of speed limit" sign to this stop line
|
void | addSpeedLimitSign |
Adds "speed limit" sign to this stop line
|
void | addYieldSign() |
Adds "yield" sign to this stop line
|
double | averageSpeed() |
Returns the actual average speed near this stop line
|
double | averageSpeed |
Returns the actual average speed near this stop line
|
int | getLaneIndexFrom() |
Returns the starting lane covered by stop line, inclusive
|
int | getLaneIndexTo() |
Returns the ending lane covered by stop line, inclusive
|
double | getLength() | |
TrafficLightSignal | getSignal() |
Returns current signal of stop line
|
double | getSpeedLimit |
If this stop line has "speed limit" sign, returns the actual speed limit value,
measured in the given units
|
boolean | isEndOfSpeedLimitSign() |
Returns
true if this stop line has "end of speed limit" sign |
boolean | isSpeedLimitSign() |
Returns
true if this stop line has "speed limit" sign |
boolean | isYieldSign() |
Returns
true if this stop line has "yield" sign |
void | onCarPassed |
Callback for "On car passed" action, executed for each car passing
through this stop line
|
void | postInitialize() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
int | queueSize() |
Returns size of queue before the stop line as sum of each lane's queue.
|
int | queueSize |
Returns size of queue before the stop line on specified lane
If lane index is invalid, an error will occur.
|
void | registerListener |
Allows to register a CarSettings instance as a listener of signal change events
|
void | setLaneIndexFrom |
Sets the starting lane covered by stop line, inclusive
|
void | setLaneIndexTo |
Sets the ending lane covered by stop line, inclusive
|
void | setSignal |
Changes the current signal.
|
void | updateDynamicProperties() |
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. |
error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
public StopLine()
Creates a new position on road.
@Deprecated public StopLine(Road road, ShapeDrawMode drawMode, boolean isPublic, boolean isOnForwardSide, double offset, int laneIndexFrom, int laneIndexTo, RoadSignType... roadSigns)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Creates a new position on road. The position is set by by segment crossing one or several guidelines within other
markup elements.
- Parameters:
road
- Road segment on which the stop line is created.drawMode
- Where to draw this space markup shape: 2D, 3D or 2D+3D.isPublic
- Iftrue
, the markup shape is visible on container's presentation.isOnForwardSide
- Flag specifying whether the stop line is created on forward or backward side of road segment.offset
- Offset (measured by guideline of lane adjacent to stop line) from beginning of road axis to stop line, in pixels.laneIndexFrom
- starting lane covered by stop line, inclusive, where 0 is lane at the road sidelaneIndexTo
- ending lane covered by stop line, inclusive, where 0 is lane at the road sideroadSigns
- comma-separated road signs, e.g.RoadSignType.newYield(), RoadSignType.newSpeedLimit(60, SpeedUnits.MPH)
@AnyLogicInternalCodegenAPI public StopLine(Road road, IStopLineDescriptor<T> d, ShapeDrawMode drawMode, boolean isPublic, boolean isOnForwardSide, double offset, int laneIndexFrom, int laneIndexTo, RoadSignType... roadSigns)
public void addSpeedLimitSign(double speedLimit, SpeedUnits units)
Adds "speed limit" sign to this stop line
- Parameters:
speedLimit
- speed limit value, measured in the given unitsunits
- speed units
public boolean isSpeedLimitSign()
Returns
true
if this stop line has "speed limit" signpublic double getSpeedLimit(SpeedUnits units)
If this stop line has "speed limit" sign, returns the actual speed limit value,
measured in the given units
- Parameters:
units
- speed units- Returns:
- speed limit, measured in the given units,
or
+infinity
if there is no speed limit sign at this stop line
public void addYieldSign()
Adds "yield" sign to this stop line
public boolean isYieldSign()
Returns
true
if this stop line has "yield" signpublic void addEndOfSpeedLimitSign()
Adds "end of speed limit" sign to this stop line
public boolean isEndOfSpeedLimitSign()
Returns
true
if this stop line has "end of speed limit" signpublic double averageSpeed(SpeedUnits units)
Returns the actual average speed near this stop line
- Parameters:
units
- speed units- Returns:
- average speed value
public double averageSpeed()
Returns the actual average speed near this stop line
- Returns:
- average speed value, meters per second
public int queueSize()
Returns size of queue before the stop line as sum of each lane's queue. See
queueSize(int)
.- Returns:
- size of queue before the stop line as sum of each lane's queue
public int queueSize(int laneIndex)
Returns size of queue before the stop line on specified lane
If lane index is invalid, an error will occur.
- Parameters:
laneIndex
- - index of the lane- Returns:
- size of queue before the stop line on specified lane
@AnyLogicInternalCodegenAPI public void onCarPassed(T car, int laneIndex)
Callback for "On car passed" action, executed for each car passing
through this stop line
- Specified by:
onCarPassed
in interfaceIStopLineDescriptor<T extends Agent>
- Parameters:
car
- the carlaneIndex
- the index of lane the car is located on, where 0 is lane at the road side
@AnyLogicInternalAPI public void postInitialize()
Description copied from interface:
AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
- Specified by:
postInitialize
in interfaceAggregatableAnimationElement
public int getLaneIndexFrom()
Returns the starting lane covered by stop line, inclusive
- Returns:
- lane number, where 0 is lane at the road side
public void setLaneIndexFrom(int laneIndexFrom)
Sets the starting lane covered by stop line, inclusive
- Parameters:
laneIndexFrom
- lane number, where 0 is lane at the road side
public int getLaneIndexTo()
Returns the ending lane covered by stop line, inclusive
- Returns:
- lane number, where 0 is lane at the road side
public void setLaneIndexTo(int laneIndexTo)
Sets the ending lane covered by stop line, inclusive
- Parameters:
laneIndexTo
- lane number, where 0 is lane at the road side
public void setSignal(TrafficLightSignal signal)
Changes the current signal. Use when stop line isn't controlled by traffic light.
- Specified by:
setSignal
in interfaceISignalable
- Parameters:
signal
- New signal
public TrafficLightSignal getSignal()
Returns current signal of stop line
- Specified by:
getSignal
in interfaceISignalable
- Returns:
- Current signal of stop line
@AnyLogicInternalAPI public void registerListener(SignalChangeListener stateChangeListener)
Allows to register a CarSettings instance as a listener of signal change events
- Specified by:
registerListener
in interfaceISignalable
- Parameters:
listener
- Add instance of SignalChangeListener interface that will listen to the event.
@AnyLogicInternalLibraryAPI public double getLength()
- Specified by:
getLength
in classAbstractRoadSidePart
@AnyLogicInternalCodegenAPI public void updateDynamicProperties()
Description copied from class:
AbstractMarkup
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
- Overrides:
updateDynamicProperties
in classAbstractMarkup