The Parking Lot space markup element allows you to draw a parking lot щт the side of a road.
A parking lot lot can be parallel (cars are parked in a line), perpendicular, or diagonal. The type of the parking lot is set in the Type property of the element.
Currently, you can only draw a parking lot with a single row. To draw a parking lot with two rows, you should draw another road with a parking lot next to it.
Use the CarMoveTo block to model the movement of the car to the parking lot. To model the presence of a car in a parking lot for a certain period of time, the CarMoveTo block should be followed by the Delay block from the Process Modeling Library. Since parking lots can accommodate a number of cars at the same time, you should check the Maximum capacity option in the parameters of the Delay block.
Demo model: Parking Lot Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files). Demo model: Parking LotOpen the model in your AnyLogic desktop installation.To draw a parking lot
-
Drag the
Parking Lot element from the Space Markup section of the
Road Traffic Library palette onto the agent diagram.
A parking lot cannot be drawn until the road has been drawn.As you move the mouse over the agent diagram, you will see that all elements other than the roads are greyed out. -
Place the mouse cursor next to the road where you want to place the parking lot. You will see that the parking lot is connected to the road. Move the mouse to place the element correctly. The parking lot will will adjust its shape to the shape of the road. Release the mouse button when ready; the element will be placed in the specified location.
- Switch to the Properties view and select the Type of the parking lot: Parallel, Perpendicular, or Diagonal.
- You can change the size of the parking lot by specifying the value in the Number of parking spaces property.
- The length of a parking space can be modified in the Length of parking space property. In addition to the length, the width is defined in the Lane width property of the road network and applies to all road network elements: roads, intersections, and so on.
- You can now specify this parking lot as a destination in the CarMoveTo block to simulate the movement of the car to the parking lot.
To adjust the position of a parking lot
- Click on the parking lot you want to edit.
-
Drag the parking lot to the desired location on the current road.
You cannot drag the parking lot to a different road.Alternatively, you can move it by changing the value of the Offset from road start property to define the exact location of the element.
- General
-
Name — The name of this parking lot. The name is used to identify and access the element from the code and properties of the flowchart blocks.
Show name — If selected, the name of the parking lot is displayed on the graphical diagram.
Lock — If selected, the parking lot is locked. Locked elements do not respond to mouse clicks, and they cannot be selected in the graphical editor until you unlock them. This is often needed when you want to prevent the element from being edited while other elements are placed over it.
Ignore — If selected, the parking lot is excluded from the model.
Type — Specifies the layout scheme of the parking lot. There are three options:
- Parallel — Parking spaces are placed in line with the road.
- Perpendicular — The cars are parked side to side, perpendicular to the road.
- Diagonal — Parking spaces are arranged at an acute angle to the road. Cars are parked side to side.
Angle, ° — [Visible and applies only if Type: Diagonal] The angle at which the parking spaces are located to the road, in degrees. You can select one of the suggested values (30°, 45°, or 60°) or enter any other value in the range [1, 90].
Number of parking spaces — Specifies the number of parking spaces (one space per car). The default is 5 spaces.
Length of parking space — Defines the length of the parking space in the length units you select from the drop-down list to the right of this field. The default length of the parking space is 6 meters.
- Position and size
-
Offset from road start — The distance from the starting point of the road to the starting point of the parking lot, in pixels.
- Visibility and presentation
-
Visible — If selected, the parking lot is visible during animation at model runtime.
Show in — Select whether the shape is displayed in both 2D and 3D animation, 2D only, or 3D only.
Agent presentation — If selected, the parking lot is also visible on the upper-level agent that hosts the agent containing this parking lot.
- Parking spaces
-
Function Description int nSpaces() Returns the total number of spaces in this parking lot. int nFree() Returns the number of free parking spaces in this parking lot. int randomFreeSpaceIndex() Returns the index of a randomly chosen free parking space. int[] getFreeSpaceIndexes() Returns an array of indexes of free parking spaces (0-based). int getParkingSpaceIndex(Agent car) Returns the index of the parking space where the given car is located (numbering starts with 0). Throws an exception if there is no specified car in the parking lot.
car — the car located in the parking lot.void setNSpaces(int parkingSpacesCount) Sets the number of parking spaces in the parking lot with parkingSpacesCount defining the number of parking spaces in the parking lot.
parkingSpacesCount — the number of parking spaces in the parking lot. - Cars
-
Function Description int nCars() Returns the number of cars located on this parking lot. Agent getCarOnSpace(int spaceIndex) Returns the car located in the parking space with the given index, or null if this space is free.
spaceIndex — the index of the parking spaceList<Agent> getCars() Returns an 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). - Force exit on timeout
-
In all the actions, the local variable agent refers either to the material item, if the lift belongs to a conveyor network, or a transporter, if the lift is a part of a network.
Function Description boolean isForceLeaving() Returns true if the guaranteed exit mode is switched on for the parking lot. In this mode, the car is guaranteed to exit the parking lot within the specified timeout. To exit the parking lot, the car requires enough space on the adjusting road lane. If the car fails to exit the parking lot during the specified time due to the intense car flow, after the timeout it will suspend the car flow on the adjusting road lane, and exit the parking lot. void setForceLeavingEnabled(boolean forceLeavingEnabled) Toggles the forced exit on timeout for the parking lot.
forceLeavingEnabled — if true, the forced exit on timeout is enabled, if false — disableddouble getForceLeavingTimeout() Returns the timeout within which the car is guaranteed to exit the parking lot, in model time units. Note that even if the forced exit mode is switched off, the function will return the current timeout value, but it will not be applied. double getForceLeavingTimeout(TimeUnits units) Returns the timeout within which the car is guaranteed to exit the parking lot, in specified time units. Note that even if the forced exit mode is switched off, the function will return the current timeout value, but it will not be applied.
units — a constant defining the time units.void setForceLeavingTimeout(double timeout) Sets the timeout within which the car is guaranteed to exit the parking lot, in model time units.
timeout — the new forced exit timeout, in model time unitsvoid setForceLeavingTimeout(double timeout, TimeUnits units) Sets the timeout within which the car is guaranteed to exit the parking lot, in specified time units.
timeout — the new forced exit timeout, in the given time units
units — constant defining the time units - Parking type
-
Function Description ParkingLotType getParkingType() Returns the type of the parking lot: parallel, perpendicular, or diagonal.
Valid values:
PARKING_LOT_PARALLEL
PARKING_LOT_PERPENDICULAR
PARKING_LOT_DIAGONALvoid setParkingType(ParkingLotType parkingType) Sets the type of the parking lot: parallel, perpendicular, or diagonal, depending on the function’s argument value.
parkingType — Defines the type of the parking lot
Valid values:
PARKING_LOT_PARALLEL
PARKING_LOT_PERPENDICULAR
PARKING_LOT_DIAGONAL - Parking space dimensions
-
Function Description double getParkingSpaceLength() Returns the length of the parking space, measured in pixels. double getParkingSpaceLength(LengthUnits units) Returns the length of the parking space, measured in the given length units. For example, getParkingSpaceLength(METER) returns the length of the parking space measured in meters.
units — a length unit constantdouble getParkingSpaceWidth() Returns the width of the parking space, measured in pixels. double getParkingSpaceWidth(LengthUnits units) Returns the width of the parking space, measured in the given length units. For example, getParkingSpaceWidth(FOOT) returns the width of the parking space measured in feet.
units — a length unit constantvoid setParkingSpaceLength(double parkingSpaceLengthInPixels) Sets the length of the parking space measured in pixels.
parkingSpaceLengthInPixels — The length of the parking space, measured in pixels.void setParkingSpaceLength(double parkingSpaceLength, LengthUnits units) Sets the length of the parking space measured in the given length units.
parkingSpaceLength — The length of the parking space, measured in the given length units.
units — a length unit constantvoid setParkingSpaceWidth(double parkingSpaceWidthInPixels) Sets the width of the parking space measured in pixels.
parkingSpaceWidthInPixels — The width of the parking space, measured in pixels.void setParkingSpaceWidth(double parkingSpaceWidth, LengthUnits units) Sets the width of the parking space measured in the given length units.
parkingSpaceWidth — The width of the parking space, measured in the given length units.
units — a length unit constant - Diagonal parking
-
Function Description int getDiagonalParkingAngle() Returns the angle at which the diagonal parking lot is located to the road, in degrees. void setDiagonalParkingAngle(int diagonalParkingAngle) Sets the angle at which the diagonal parking lot is located to the road, in degrees.
diagonalParkingAngle — the angle, the value should be in the range [30..89] - Visibility
-
Function Description void setVisible(boolean v) Sets the visibility of the parking lot.
v — the visibility of the parking lot. If true, the parking lot is visible, if false — not visible.boolean isVisible() Returns the visibility of the parking lot. If it returns true, the parking lot is visible, if false — not visible. - Location
-
Function Description double getOffset() Returns the distance (in pixels) from the road start to the start of the parking lot. double getOffset(LengthUnits units) Returns the distance (in given units) from the road start to the start of the parking lot.
units — a length unit constantboolean isOnForwardSide() Returns true if the parking lot is adjacent to the forward lane, false if it is adjacent to the backward lane. Road getRoad() Returns the road this parking lot is adjacent to. RoadNetwork getRoadNetwork() Returns the road network this parking lot belongs to. - Level
-
Function Description Level getLevel() Returns the level on which this parking lot is located. - Removal
-
Function Description void remove() Removes the parking lot from the presentation. If the parking lot is not a part of presentation, the function does nothing. Removal from the presentation does not necessarily mean removal from the model logic, since logical networks and routes may have been created prior to removal and survive.
-
How can we improve this article?
-