AnyLogic 9
Expand
Font size

Bus stop

The Bus Stop space markup element allows you to draw a bus stop on the side of a road (in the direction of travel).

Use the CarMoveTo block to model the movement of the bus to the bus stop. To model the presence of a bus at a bus stop for a certain period of time, the CarMoveTo block should be followed by the Delay block from the Process Modeling Library.

Demo model: Bus Stop Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files). Demo model: Bus StopOpen the model in your AnyLogic desktop installation.

To draw a bus stop

  1. Drag the  Bus Stop element from the Space Markup section of the  Road Traffic Library palette onto the agent diagram containing a road.
    A stop line cannot be drawn until the road has been drawn.
    As you move the mouse over the agent diagram, you will see that all elements other than the roads are greyed out.
  2. Place the mouse next to the road just where you want to place the element. You will see that the bus stop is connected to the road. Move the mouse to place the element and release the mouse button. You can change the location of the bus stop by dragging it along the road.
  3. You can change the length of the bus stop by specifying the Length value in the element’s properties. Apart from the length, the width is defined in the Lane width property of the road network and applies to all road network elements: roads, intersections, and so on.
  4. You can now specify this bus stop as the destination in the properties of the CarMoveTo block.

To adjust the position of a bus stop

  1. Click the bus stop you want to edit.
  2. Drag the bus stop to the desired location on the current road.
    You cannot drag the bus stop to a different road.
    Alternatively, you can change the position of the bus stop by changing the value of the Offset from road start property.

Properties

General

Name — The name of this bus stop. The name is used to identify and access the element from the code and properties of the flowchart blocks.

Show name — If selected, the name of the bus stop is displayed on the graphical diagram.

Lock — If selected, the bus stop is locked. Locked elements do not respond to mouse clicks, and they cannot be selected in the graphical editor until you unlock them. This is often needed when you want to prevent the element from being edited while other elements are placed over it.

Ignore — If selected, the bus stop is excluded from the model.

Length — Defines the length of the bus stop in the length units. Select the units from the drop-down menu to the right of this field. The default length of the bus stop is 20 meters.

Position and size

Offset from road start — The distance (in pixels) from the starting point of the road to the starting point of the bus stop, in pixels.

Visibility and presentation

Visible — If selected, the bus stop is visible during animation at model runtime.

Show in — Select whether the shape is displayed in both 2D and 3D animation, 2D only, or 3D only.

Agent presentation — If selected, the bus stop is also visible on the upper-level agent that hosts the agent containing this bus stop.

Functions

Cars
Function Description
List<Agent> getCars() Returns an ordered list of cars located on this bus stop. The first car in the list is the nearest one to the exit point from the bus stop (is the first one to exit the bus stop).
int nCars() Returns the number of cars located on this bus stop.
Length
Function Description
double getLength() Returns the length of the bus stop on the adjacent side to the road, measured in pixels.
double getLength(LengthUnits units) Returns the length of the bus stop on the adjacent side to the road, measured in the given length units. For example, getLength(METER) returns the length of bus stop measured in meters.

units — a length unit constant.
void setLength(double lengthInPixels) Sets the length of the bus stop to lengthInPixels.

lengthInPixels — The length of the bus stop, measured in pixels.
void setLength(double length, LengthUnits units) Sets the length of the bus stop, measured in the given length units. For example, setLength(15, METER) sets the length to 15 meters.

length — The length of bus stop, measured in the given length units.
units — A length unit constant.
Visibility
Function Description
void setVisible(boolean v) Sets the visibility of the bus stop.

v — the visibility of the bus stop. If true, the bus stop is visible, if false — not visible.
boolean isVisible() Returns the visibility of the bus stop. If it returns true, the bus stop is visible, if false — not visible.
Location
Function Description
double getOffset() Returns the distance (in pixels) from the road start to the start of the bus stop.
double getOffset(LengthUnits units) Returns the distance (in the given units) from the road start to the start of the bus stop.

units — A length unit constant
boolean isOnForwardSide() Returns true if the bus stop is adjacent to the forward lane, false if it is adjacent to the backward lane.
Road getRoad() Returns the road on which the bus stop is located.
RoadNetwork getRoadNetwork() Returns the road network the bus stop belongs to.
Level
Function Description
Level getLevel() Returns the level on which this bus stop is located.
Removal
Function Description
void remove() Removes the bus stop from the presentation. If the bus stop is not a part of presentation, the function does nothing.
Removal from the presentation does not necessarily mean removal from the model logic, since logical networks and routes may have been created prior to removal and survive.
How can we improve this article?