public class ParkingLot extends AbstractRoadSidePart
Constructor and Description |
---|
ParkingLot() |
ParkingLot(Road road,
ShapeDrawMode drawMode,
boolean isPublic,
boolean isOnForwardSide,
double offset,
ParkingLotType type,
int parkingSpacesCount,
double parkingSpaceWidthInMeters,
double parkingSpaceLengthInMeters)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method and Description |
---|---|
Agent |
getCarOnSpace(int spaceIndex)
Returns car located in the parking space with the given index,
or
null if this space is free |
java.util.List<Agent> |
getCars()
Returns ordered list of cars located on this parking lot.
|
int[] |
getFreeSpaceIndexes()
Returns array of indexes of free parking spaces
|
double |
getLength() |
double |
getParkingSpaceLength()
Returns the length of parking space
|
double |
getParkingSpaceLength(LengthUnits units)
Returns the length of parking space
|
double |
getParkingSpaceWidth()
Returns the width of parking space
|
double |
getParkingSpaceWidth(LengthUnits units)
Returns the width of parking space
|
ParkingLotType |
getParkingType()
Returns parking type of the parking lot, parallel or perpendicular.
|
int |
nCars()
Returns number of cars located on this parking lot
|
int |
nFree()
Returns the number of free parking spaces in this parking lot
|
int |
nSpaces()
Returns the total number of spaces in this parking lot
|
void |
postInitialize()
This method is internal and shouldn't be called by user.
|
int |
randomFreeSpaceIndex()
Returns the index of randomly chosen free parking space
|
void |
setDataSource(ParkingLotDataSource dataSource) |
void |
setNSpaces(int parkingSpacesCount)
Sets number of parking spaces in parking lot.
|
void |
setParkingSpaceLength(double parkingSpaceLengthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release. Please use method with units argument instead.
|
void |
setParkingSpaceLength(double parkingSpaceLength,
LengthUnits units)
Sets the length of parking space
|
void |
setParkingSpaceWidth(double parkingSpaceWidthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release. Please use method with units argument instead.
|
void |
setParkingSpaceWidth(double parkingSpaceWidth,
LengthUnits units)
Sets the width of parking space
|
void |
setParkingType(ParkingLotType parkingType)
Sets parking type of the parking lot.
|
isOnForwardSide, setOnForwardSide
getOffset, getOffset, getRoad, setOffset, setOffset, setRoad
contains, getLevel, getRoadNetwork, setDebugInfoVisible, setRoadNetwork
error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public ParkingLot()
@Deprecated public ParkingLot(Road road, ShapeDrawMode drawMode, boolean isPublic, boolean isOnForwardSide, double offset, ParkingLotType type, int parkingSpacesCount, double parkingSpaceWidthInMeters, double parkingSpaceLengthInMeters)
road
- Road segment on which the parking lot 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 parking lot is created on forward or backward side of road segment.offset
- Offset (measured by guideline of lane adjacent to parking lot) from beginning of road axis to beginning of parking lot, in pixels.type
- Parking type, parallel or perpendicular.parkingSpacesCount
- Count of parking spaces to be created.parkingSpaceWidthInMeters
- the width of parking space, measured in metersparkingSpaceLengthInMeters
- the length of parking space, measured in meters@AnyLogicInternalAPI public void setDataSource(ParkingLotDataSource dataSource)
public int nFree()
public int randomFreeSpaceIndex()
public Agent getCarOnSpace(int spaceIndex)
null
if this space is freespaceIndex
- index of parking spacenull
public int nCars()
public java.util.List<Agent> getCars()
public int[] getFreeSpaceIndexes()
randomFreeSpaceIndex()
@AnyLogicInternalAPI public void postInitialize()
AggregatableAnimationElement
public ParkingLotType getParkingType()
public void setParkingType(ParkingLotType parkingType)
parkingType
- type of the parking lot, parallel or perpendicular.public int nSpaces()
public void setNSpaces(int parkingSpacesCount)
parkingSpacesCount
- number of parking spaces in the parking lot.public double getParkingSpaceLength()
public double getParkingSpaceLength(LengthUnits units)
units
- length units@Deprecated public void setParkingSpaceLength(double parkingSpaceLengthInPixels)
parkingSpaceLengthInPixels
- the length of parking space in XY-projection, measured in pixelspublic void setParkingSpaceLength(double parkingSpaceLength, LengthUnits units)
parkingSpaceLength
- the length of parking space in XY-projection, measured in the given unitsunits
- length unitspublic double getParkingSpaceWidth()
public double getParkingSpaceWidth(LengthUnits units)
units
- length units@Deprecated public void setParkingSpaceWidth(double parkingSpaceWidthInPixels)
parkingSpaceWidthInPixels
- the width of parking space in XY-projection, measured in pixelspublic void setParkingSpaceWidth(double parkingSpaceWidth, LengthUnits units)
parkingSpaceWidth
- the width of parking space in XY-projection, measured in the given unitsunits
- length units@AnyLogicInternalLibraryAPI public double getLength()
getLength
in class AbstractRoadSidePart
Copyright © AnyLogic North America, LLC. All Rights Reserved.