This project aims to recommend optimal garage dimensions based on the analysis of historical usage data. It takes into account the average and peak daily demand for cars and motorbikes and suggests a suitable number of levels, cars per level, and motorbikes per level to meet the target occupancy rate.
- Reads and processes historical garage usage data.
- Calculates average daily demand and peak daily demand for cars and motorbikes.
- Recommends garage dimensions based on target occupancy rate and number of levels.
- Simple web interface to input target occupancy rate and number of levels, and displays the recommended garage dimensions.
- Python 3.6 or higher
- pandas
- numpy
- Flask
- Clone this repository:
git clone https://github.com/phuonganhniie/venice_parking_garage.git
- Change into the project directory:
cd venice_parking_garage
- Install the required packages:
pip install -r requirements.txt
Note: It is recommended to install the required project packages from requirements.txt
within a Python virtual environment to avoid potential conflicts with other packages on your system.
-
Prepare a CSV file with the historical usage data. The file should have the following columns:
Date
,Cars in
,Cars out
,Motorbikes in
,Motorbikes out
. -
Run the
app.py
for run the application:
python app.py
-
Open your web browser and navigate to
http://127.0.0.1:5000
. -
Upload your CSV file containing the historical data.
-
Enter the desired occupancy rate (between 0 and 1) and the number of garage levels (greater than or equal to 1).
-
Click "Submit" to calculate the recommended garage dimensions.
-
The results will be displayed on the same page.
Note: If the provided CSV file does not have the required columns, an error message will be displayed. Ensure that your CSV file has the correct format before uploading it.
The Target Occupancy Rate
input field is the desired percentage of the garage's total capacity that should be occupied at any given time. It balances the trade-offs between cost, customer satisfaction, and parking availability. A lower occupancy rate results in more available slots but a larger, potentially costlier garage. A higher occupancy rate leads to fewer available slots, a smaller garage, but may cause longer waiting times for parking. Input your desired Target Occupancy Rate
, and the system will calculate the optimal number of slots for cars and motorbikes.
The project consists of the following modules:
venice_parking_garage/
β
βββ data/
β βββ historical_data.csv
β
βββ src/
β βββ __init__.py
β βββ data_processing.py
β βββ analysis.py
β βββ recommendations.py
β
βββ templates/
β βββ index.html
β
βββ tests/
β βββ __init__.py
β βββ test_analysis.py
β βββ test_data_processing.py
β βββ test_recommendations.py
β
βββ app.py
βββ README.md
βββ requirements.txt
data_processing.py
: This module is responsible for reading the input CSV file and calculating the daily usage data.analysis.py
: This module performs analysis on the daily usage data to determine the average daily demand and peak daily demand for cars and motorbikes.recommendations.py
: This module calculates the number of parking slots required for cars and motorbikes, and recommends garage dimensions based on the demand data and the number of parking levels.main.py
: This module serves as the entry point for the project. It reads the input data, processes it, performs analysis, calculates recommendations, and displays the results.
Unit tests are provided for analysis.py
, data_processing.py
and recommendations.py
. To run the tests, execute the following commands:
python -m unittest tests/test_analysis.py
python -m unittest tests/test_data_processing.py
python -m unittest tests/test_recommendations.py