- Timestamp inside
input.txt
are always arranged in a chronologically manner (top-down) - There will only be two types of events input, i.e.
Enter
orExit
- Observer Pattern
- With this design pattern, can easily perform additional operations such as sending a notification upon Vehicle entry, sends a Slack message, send information to our monitoring system etc. Making the system more extensible.
- Go to https://replit.com/@JerryNg1/automated-valet-car-parking-backend.
- Hit the "Play/Run" button & wait a couple of seconds for dependency installation.
- Observe the output.
- Update
input.txt
accordingly. i.e.vim input.txt
- Hit the "Play/Run" button again.
- Repeat.
This project uses Python 3.9. You may install Python 3.9 on Ubuntu 16.04 using the steps below:
# 1. Update the apt package list
apt-get update
# 2. Refresh local apt keys from Ubuntu key server
apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
# 3. Install software-properties-common to be able to add 3rd party repositories to apt
apt-get -y install software-properties-common
# 4. Add deadsnakes repository to apt, then run update
add-apt-repository ppa:deadsnakes/ppa
apt get update
# 5. Now that apt is ready, install python3.9
apt-get -y install python3.9
This step is required only for local development to ensure code quality.
We use poetry to manage our dependencies.
Though, there isn't any third party dependencies required for the project to work properly. We merely use pre-commit
, flake8
, and autopep8
to improve code quality.
poetry install
pre-commit install
-
Make sure you have Python3.9 installed on your local machine (see Requirement].
-
Clone this repository.
-
Optional: Update
input.txt
accordingly. -
Run the
python3 main.py
-
Output will be printed in your terminal.
# Example output in your terminal using the default `input.txt`. > python3 main.py Accept MotorcycleLot1 Accept CarLot1 MotorcycleLot1 2 Accept CarLot2 Accept CarLot3 Reject CarLot3 6
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Before you begin your development work, make sure you have installed pre-commit hooks.
Some example useful invocations:
pre-commit install
: Default invocation. Installs the pre-commit script alongside any existing git hooks.pre-commit install --install-hooks --overwrite
: Idempotently replaces existing git hook scripts with pre-commit, and also installs hook environments
- Fork this
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request