PolyParkTrack
Introduction
This is the prototype of how PolyParkTrack should behave. For this prototype, the application reads in the JSON file containing required information for each parking structure in Cal Poly campus. Then the GUI displays the number of the parking spot in each Parking Structure on cal poly are shown on the right with the format of Parking Structure #: #. The first # referring to the parking structure number, the second # is referring to the number of available parking spots in that parking structure.
Next to the field containing the number of parking spots available in each parking structure, is a static cal poly map that allows users to pick the location he/she want to start. After picking the location, the user is able to input on the text field the car type he/she wants to find where 1: Compact, 2:Electric, 3: Handicap, 4: Normal. Then the user is able to press "find the spot" button on the right of the screen. After pressing "find the spot" button, a bunch of text on the button of the screen will be shown. The bottom text displays the information containing the nearest parking structure with the closest parking spot that user has picked. Under the parking spot information, are the text containing the distance and time takes to reach that parking spot.
Getting Started
-
This is the starting screen of the PolyParkTrack.
- Left side of the screen displays a number of available parking spots in each parking structure.
- Next to the text is the static Cal Poly Campus map.
- Text fields and "find the spot" button are under the static map.
- And text displaying "Welcome to PolyParkTrack" is shown on the bottom of the screen.
-
Then you are able to pick a starting location in the static map on the right.
- A transparent circle will be shown on the map if you pick a valid location in the static map.
- Otherwise, nothing should be happening.
- If you press the "find the spot" without a starting location, the application will complain about it and display "Pick a starting location".
-
After picking the location, you are able to enter the parking type for your car, 1: Compact, 2: Electric, 3: Handicap, 4: Normal as shown below
- This field is not required to be filled to do find the nearest parking spot, it will be defaulted to be Normal.
- String or numbers are both valid for car type field
- 1 or Compact for Compact Car parking spot
- 2 or Electric for Electric Car Parking spot
- 3 or Handicap for Handicap Parking spot
- 4 or Normal for Normal Parking Spot
- The Message "Invalid Car Type" will display if you pick any type other than number and string referring to the car type
-
The last step will be pressing the "find the spot" after you have to pick the starting location and entered a valid car type.
- The message will display the location of the nearest parking spot that you try to find and the distance and time it takes to get to the destination.
- The message will display the location of the nearest parking spot that you try to find and the distance and time it takes to get to the destination.
Implementation
- Breath-First Search to find the distance between User picked location and nearest parking structure
- LinkedList as a queue in Breath-First Search to find the distance
- Observable pattern
- User is the subject
- If the user changes the location or changes the car type, then the observer will be notified.
- Calculation is the Observer
- If the user changes the location or car type, then calculation object will find the new nearest parking type available and display it on the screen.
- User is the subject
UML class diagram
Architecture
- 3-tier architecture
- Presentation layer -- Javafx
- Business logic -- Calculation object that contains all the finding the nearest parking spot logics: Breath-first search, distance calculation, time calculation and others
- Database layer -- Read in the written JSON file to set up the parking structures for this application.
Useful Features
- The purpose of this software is to help useful finding the nearest parking structure available. The current status of PolyParkTrack has fulfilled this requirement by giving the user location and the nearest parking spot will be shown to the bottom of the screen as shown in the example above.
- I have implemented numbers of parking spots available for each parking structure to PolyParkTrack as well.
- It also shows the distance between user location and the nearest parking structure.
- Implemented the time takes to travel from user location to nearest parking structure.
- Other than that, the current status of PolyParkTrack allows the user to pick the parking spot he/she wants to find in Cal Poly.
Built With
- Maven - Dependency Management