AnyLogic
Expand
Font size
All Superinterfaces:
Serializable

public interface RoadDataSource
extends Serializable

Method Summary

Modifier and TypeMethodDescription
doubleaverageSpeed(boolean isOnForwardSide, double offset, SpeedUnits units)
Returns the average speed on the given road direction near the specified offset
List<Agent>getCars(boolean isOnForwardSide)
Returns ordered list of cars located on the given direction.
intnCars(boolean isOnForwardSide)
Returns number of cars located on the given direction.
intnCars(boolean isOnForwardSide, int laneIndex)
Returns number of cars located on the given direction.
default intqueueSize(boolean isForwardSide, int laneIndexFrom, int laneIndexTo, double offset) 

Method Details

averageSpeed

double averageSpeed(boolean isOnForwardSide,
 double offset,
 SpeedUnits units)
Returns the average speed on the given road direction near the specified offset
Parameters:
isOnForwardSide - true if direction is along road axis line, false otherwise
offset - offset from the beginning of road axis line
units - speed units
Returns:
average speed value

nCars

int nCars(boolean isOnForwardSide)
Returns number of cars located on the given direction.
Parameters:
isOnForwardSide - true if direction is along road axis line, false otherwise
Returns:
number of cars

nCars

int nCars(boolean isOnForwardSide,
 int laneIndex)
Returns number of cars located on the given direction.
Parameters:
isOnForwardSide - true if direction is along road axis line, false otherwise
laneIndex - zero-based index of lane. Lanes are numbered from outmost (that has index 0) to inmost
Returns:
number of cars

queueSize

@AnyLogicInternalAPI
default int queueSize(boolean isForwardSide,
 int laneIndexFrom,
 int laneIndexTo,
 double offset)

getCars

List<Agent> getCars(boolean isOnForwardSide)
Returns ordered list of cars located on the given direction. The first car in the list is the nearest one to the exit point from road (seems like be the first one to exit the road, if there is no acceleration)
Parameters:
isOnForwardSide - true if direction is along road axis line, false otherwise
Returns:
ordered list of cars