AnyLogic
Expand
Font size
All Superinterfaces:
RoadBasicDataSource, Serializable

public interface ParkingLotDataSource
extends RoadBasicDataSource

Method Summary

Modifier and TypeMethodDescription
AgentgetCarOnSpace(int spaceIndex)
Returns car located in the parking space with the given index, or null if this space is free
int[]getFreeSpaceIndexes()
Returns array of indexes of free spaces
intnFree()
Returns the number of free spaces in this parking lot
intrandomFreeSpaceIndex()
Returns the index of randomly chosen free parking space

Methods inherited from interface com.anylogic.engine.markup.RoadBasicDataSource

getCars, nCars

Method Details

nFree

int nFree()
Returns the number of free spaces in this parking lot
Returns:
the number of free spaces

randomFreeSpaceIndex

int randomFreeSpaceIndex()
Returns the index of randomly chosen free parking space
Returns:
free parking space index (0, 1, 2,..)

getCarOnSpace

Agent getCarOnSpace(int spaceIndex)
Returns car located in the parking space with the given index, or null if this space is free
Parameters:
spaceIndex - index of parking space
Returns:
agent (car) or null

getFreeSpaceIndexes

int[] getFreeSpaceIndexes()
Returns array of indexes of free spaces
Returns:
ordered array of indexes of free spaces (0-based)
See Also:
randomFreeSpaceIndex()