Package com.anylogic.engine.markup
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadSidePart
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadPart
- Methods inherited from class com.anylogic.engine.markup.AbstractRoadMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Constructor Details
- Method Details
- setDataSource
- getParkingSpaceIndex
- nFree
- getForceLeavingTimeout
- getForceLeavingTimeout
- isForceLeaving
- randomFreeSpaceIndex
- getCarOnSpace
- nCars
- getCars
- getFreeSpaceIndexes
- postInitialize
- getParkingType
- getDiagonalParkingAngle
- setDiagonalParkingAngle
- setParkingType
- nSpaces
- setNSpaces
- setForceLeavingEnabled
- setForceLeavingTimeout
- setForceLeavingTimeout
- getParkingSpaceLength
- getParkingSpaceLength
- setParkingSpaceLength
- setParkingSpaceLength
- getParkingSpaceWidth
- getParkingSpaceWidth
- setParkingSpaceWidth
- setParkingSpaceWidth
- getLength
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,SVGElement
,UsdElement
,Serializable
public class ParkingLot extends AbstractRoadSidePart
Class representing a set of parking spaces along border of a road segment. Parallel and perpendicular parking types are supported.
Parking lot belongs to some road segment. One road segment can contain several parking lots.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
ParkingLot() | |
ParkingLot |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method | Description |
---|---|---|
Agent | getCarOnSpace |
Returns car located in the parking space with the given index,
or
null if this space is free |
List<Agent> | getCars() |
Returns ordered list of cars located on this parking lot.
|
int | getDiagonalParkingAngle() |
Returns parking angle value.
|
double | getForceLeavingTimeout() |
Returns the delay time after which cars leaving will be forced
(i.e.
|
double | getForceLeavingTimeout |
Returns the delay time after which cars leaving will be forced
(i.e.
|
int[] | getFreeSpaceIndexes() |
Returns array of indexes of free parking spaces
|
double | getLength() | |
int | getParkingSpaceIndex |
Returns the index of the parking space where the given car is located.
|
double | getParkingSpaceLength() |
Returns the length of parking space
|
double | getParkingSpaceLength |
Returns the length of parking space
|
double | getParkingSpaceWidth() |
Returns the width of parking space
|
double | getParkingSpaceWidth |
Returns the width of parking space
|
ParkingLotType | getParkingType() |
Returns parking type of the parking lot, parallel or perpendicular (diagonal)
|
boolean | isForceLeaving() |
Returns true if car will leave the parking lot forcibly after timeout (if specified)
(i.e.
|
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.
it may be removed/renamed in future. |
int | randomFreeSpaceIndex() |
Returns the index of randomly chosen free parking space
|
void | setDataSource | |
void | setDiagonalParkingAngle |
Sets diagonal angle of the parking lot spaces.
|
void | setForceLeavingEnabled |
Switches the forced parking leaving mode on or off according to the given value.
|
void | setForceLeavingTimeout |
Sets the force parking leaving timeout value in model time units.
|
void | setForceLeavingTimeout |
Sets the force parking leaving timeout value in specified time units.
|
void | setNSpaces |
Sets number of parking spaces in parking lot.
|
void | setParkingSpaceLength |
Deprecated.
this method is deprecated and may be removed in the next release.
|
void | setParkingSpaceLength |
Sets the length of parking space
|
void | setParkingSpaceWidth |
Deprecated.
this method is deprecated and may be removed in the next release.
|
void | setParkingSpaceWidth |
Sets the width of parking space
|
void | setParkingType |
Sets parking type of the parking lot.
|
error, getDrawMode, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getOrGenerateUSDId, 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, int parkingAngle, boolean forceLeavingEnabled, double forceLeavingTimeoutInSeconds)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Creates parking lot with specified number of parking spaces along the specified side (forward or backward) of the specified road segment at the specified offset.
- Parameters:
road
- Road segment on which the parking lot is created.drawMode
- Where to draw this space markup shape: 2D, 3D or 2D+3D.ispublic
- Iftrue
, 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, perpendicular or diagonal.parkingSpacesCount
- Count of parking spaces to be created.parkingSpaceWidthInMeters
- the width of parking space, measured in metersparkingSpaceLengthInMeters
- the length of parking space, measured in metersparkingAngle
- the angle of diagonal parking, measured in degreesforceLeavingEnabled
- if true then car will force parking leaving after some timeoutforceLeavingTimeoutInSeconds
- the force parking leaving timeout value
@AnyLogicInternalAPI public void setDataSource(ParkingLotDataSource dataSource)
public int getParkingSpaceIndex(Agent car)
Returns the index of the parking space where the given car is located.
- Returns:
- parking space index for specified car (0, 1, 2,..)
- Throws:
exception
- if there is no specified car in the parking lot.
public int nFree()
Returns the number of free parking spaces in this parking lot
- Returns:
- the number of free parking spaces
public double getForceLeavingTimeout()
Returns the delay time after which cars leaving will be forced
(i.e. leaving cars will have a bigger priority than cars in the basic road lane).
- Returns:
- delay in model time units before the forcing of car leaving.
public double getForceLeavingTimeout(TimeUnits units)
Returns the delay time after which cars leaving will be forced
(i.e. leaving cars will have a bigger priority than cars in the basic road lane).
- Returns:
- delay before the forcing of car leaving.
public boolean isForceLeaving()
Returns true if car will leave the parking lot forcibly after timeout (if specified)
(i.e. leaving cars will have a bigger priority than cars in the basic road lane).
- Returns:
- true is car will force parking leaving after some timeout.
public int randomFreeSpaceIndex()
Returns the index of randomly chosen free parking space
- Returns:
- free parking space index (0, 1, 2,..)
public 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
public int nCars()
Returns number of cars located on this parking lot
- Returns:
- number of cars
public List<Agent> getCars()
Returns ordered list of cars located on this parking lot.
The first car in the list is the nearest one to the exit point
from parking lot (is the first one to exit the parking lot).
- Returns:
- ordered list of cars
public int[] getFreeSpaceIndexes()
Returns array of indexes of free parking spaces
- Returns:
- ordered array of indexes of free parking spaces (0-based)
- See Also:
-
randomFreeSpaceIndex()
@AnyLogicInternalAPI public void postInitialize()
Description copied from interface:
AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
public ParkingLotType getParkingType()
Returns parking type of the parking lot, parallel or perpendicular (diagonal)
- Returns:
- Parking type of the parking lot, parallel or perpendicular (diagonal)
public int getDiagonalParkingAngle()
Returns parking angle value. It is 0 for parallel parking and belongs to [1..90]
for perpendicular ones.
- Returns:
- diagonal angle of all parking spaces of the parking lot.
public void setDiagonalParkingAngle(int diagonalParkingAngle)
Sets diagonal angle of the parking lot spaces.
Must be integer value between 1 and 90.
- Parameters:
parkingAngle
- is the parking angle value in degrees.
public void setParkingType(ParkingLotType parkingType)
Sets parking type of the parking lot.
- Parameters:
parkingType
- type of the parking lot, parallel or perpendicular.
public int nSpaces()
Returns the total number of spaces in this parking lot
- Returns:
public void setNSpaces(int parkingSpacesCount)
Sets number of parking spaces in parking lot.
- Parameters:
parkingSpacesCount
- number of parking spaces in the parking lot.
public void setForceLeavingEnabled(boolean forceLeavingEnabled)
Switches the forced parking leaving mode on or off according to the given value.
- Parameters:
forceLeavingEnabled
- forced parking leaving mode
public void setForceLeavingTimeout(double timeout, TimeUnits units)
Sets the force parking leaving timeout value in specified time units.
- Parameters:
timeout
- the force parking leaving timeout value (in specified time units).units
- timeout's time units
public void setForceLeavingTimeout(double timeout)
Sets the force parking leaving timeout value in model time units.
- Parameters:
timeout
- the force parking leaving timeout value (in model time units).
public double getParkingSpaceLength()
Returns the length of parking space
- Returns:
- the length of parking space in XY-projection, measured in pixels (using scale of the agent which acts as 'Space')
public double getParkingSpaceLength(LengthUnits units)
Returns the length of parking space
- Parameters:
units
- length units- Returns:
- the length of parking space in XY-projection, measured in the given units
@Deprecated public void setParkingSpaceLength(double parkingSpaceLengthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release. Please use method with units argument instead.
Sets the length of parking space
- Parameters:
parkingSpaceLengthInPixels
- the length of parking space in XY-projection, measured in pixels
public void setParkingSpaceLength(double parkingSpaceLength, LengthUnits units)
Sets the length of parking space
- Parameters:
parkingSpaceLength
- the length of parking space in XY-projection, measured in the given unitsunits
- length units
public double getParkingSpaceWidth()
Returns the width of parking space
- Returns:
- the width of parking space in XY-projection, measured in pixels (using scale of the agent which acts as 'Space')
public double getParkingSpaceWidth(LengthUnits units)
Returns the width of parking space
- Parameters:
units
- length units- Returns:
- the width of parking space in XY-projection, measured in the given units
@Deprecated public void setParkingSpaceWidth(double parkingSpaceWidthInPixels)
Deprecated.
this method is deprecated and may be removed in the next release. Please use method with units argument instead.
Sets the width of parking space
- Parameters:
parkingSpaceWidthInPixels
- the width of parking space in XY-projection, measured in pixels
public void setParkingSpaceWidth(double parkingSpaceWidth, LengthUnits units)
Sets the width of parking space
- Parameters:
parkingSpaceWidth
- the width of parking space in XY-projection, measured in the given unitsunits
- length units
@AnyLogicInternalLibraryAPI public double getLength()
- Specified by:
getLength
in classAbstractRoadSidePart