AnyLogic AnyLogic
Expand
Font size
All Superinterfaces:
RoadBasicDataSource, java.io.Serializable

public interface ParkingLotDataSource
extends RoadBasicDataSource

Method Summary

All Methods Instance Methods Abstract Methods 
Agent getCarOnSpace​(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
int nFree()
Returns the number of free spaces in this parking lot
int randomFreeSpaceIndex()
Returns the index of randomly chosen free parking space
Modifier and Type Method Description

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

getCars, nCars

Method Detail

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()
How can we improve this article?