AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, SVGElement, Serializable

public class BusStop
extends AbstractRoadSidePart
Class representing a bus stop located along border of a road segment.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
BusStop() 
BusStop(Road road, ShapeDrawMode drawMode, boolean isPublic, boolean isOnForwardSide, double offset, double lengthInMeters)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
List<Agent>getCars()
Returns ordered list of cars located on this bus stop.
doublegetLength()
Returns length of bus stop along border with lane adjacent to bus stop, measured in pixels.
doublegetLength(LengthUnits units)
Returns length of bus stop measured in the given units along border with lane adjacent to bus stop.
intnCars()
Returns number of cars located on this bus stop
voidpostInitialize()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidsetDataSource(RoadBasicDataSource dataSource) 
voidsetLength(double lengthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release.
voidsetLength(double length, LengthUnits units)
Sets length of bus stop measured in the given units along border with lane adjacent to bus stop

Methods inherited from class com.anylogic.engine.markup.AbstractRoadSidePart

isOnForwardSide, setOnForwardSide

Methods inherited from class com.anylogic.engine.markup.AbstractRoadPart

getOffset, getOffset, getRoad, setOffset, setOffset, setRoad

Methods inherited from class com.anylogic.engine.markup.AbstractRoadMarkup

contains, getLevel, getRoadNetwork, setDebugInfoVisible, setRoadNetwork

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

BusStop

public BusStop()

BusStop

@Deprecated
public BusStop(Road road,
 ShapeDrawMode drawMode,
 boolean isPublic,
 boolean isOnForwardSide,
 double offset,
 double lengthInMeters)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Creates a new road bus stop along the specified side (forward or backward) of the specified road segment at the specified offset.
Parameters:
road - Road segment on which the bus stop is created.
drawMode - Where to draw this space markup shape: 2D, 3D or 2D+3D.
ispublic - If true, the markup shape is visible on container's presentation.
isOnForwardSide - Flag specifying whether the bus stop is created on forward or backward side of road segment.
offset - Offset (measured by guideline of lane adjacent to bus stop) from beginning of road axis to beginning of bus stop, in pixels.
lengthInMeters - Length of bus stop measured in meters along border with lane adjacent to bus stop.

Method Details

setDataSource

@AnyLogicInternalAPI
public void setDataSource(RoadBasicDataSource dataSource)

nCars

public int nCars()
Returns number of cars located on this bus stop
Returns:
number of cars

getCars

public List<Agent> getCars()
Returns ordered list of cars located on this bus stop. The first car in the list is the nearest one to the exit point from bus stop (is the first one to exit the bus stop).
Returns:
ordered list of cars

postInitialize

@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.

getLength

public double getLength()
Returns length of bus stop along border with lane adjacent to bus stop, measured in pixels.
Specified by:
getLength in class AbstractRoadSidePart
Returns:
Length of bus stop in XY-projection, measured in pixels.

getLength

public double getLength(LengthUnits units)
Returns length of bus stop measured in the given units along border with lane adjacent to bus stop.
Returns:
Length of bus stop in XY-projection, in the given units.

setLength

@Deprecated
public void setLength(double lengthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release. Please use method with units argument instead.
Sets length of bus stop along border with lane adjacent to bus stop
Parameters:
lengthInPixels - of bus stop in XY-projection, measured in pixels

setLength

public void setLength(double length,
 LengthUnits units)
Sets length of bus stop measured in the given units along border with lane adjacent to bus stop
Parameters:
length - of bus stop in XY-projection
units - length units