Project Whitepaper

https://jesien.net/taxi

In the project, there are 5 base classes:
• Registry
• Agency
• Driver
• Customer
• Trip

Registry contains a list of references to all agencies and customers
created. It is a overlooking class, that does not make any changes in the classes – just holds the information about their existence.
Agency is a class, which contains references to drivers that work for the given agency, its properties – ID, regions of operation, fees and revenue.
There exists a child class Premium Agency which is a modification of Agency with added premiumFee field. The drives taken with Premium Agency take half the time for a customer, but cost more.
Driver is a class which holds information about a driver. Each driver has to be assigned to at least one agency. The driver’s regions of operation are a combination of all regions which their agencies operate one. If a driver is assigned to an Agency and Premium Agency at the same time, the regions of the operation are separated according to the agencies.
Customer is the main operating class of the application. They can request a ride from point A to point B, select which driver they want to drive with and finalize the journey.
Trip class contains all of the data about a single journey taken by the customer.


All the history is happening on a given city map. It consists of regions which are linked with each other, and the times of travel between different regions differ.
When the customer requests a ride with requestRide(), the program finds all drivers that can take that trip, calculates the best path for them time-wise using Dijkstra algorithm and outputs up to three best options with their prices calculated. The customer can choose which course does they want to take, after which the customer’s expenses, driver’s and agencies’ revenues are updated – driver gets 50% of the whole course cost, and agencies divide the rest between them.
One trip can be operated only by one driver, but under multiple agencies.
The application allows the user for creating their own scenarios – creating Agencies, Drivers and Customers, and requesting the rides – using a simple CLI menu.

Important classes’ data:

Registry
• List of agencies
• List of customers
Agency
• Agency Type (normal/premium)
• ID
• List of drivers
• Revenue
• Regions of operation
• Fees
Driver
• Personal info
• Revenue
• Agencies they work for
• Regions of operation
• Ride history
Customer
• ID
• Ride history
• Expenses
Trip
• Ride info – origin, destination, price
• Driver
• Customer
• Agencies used during the trip
• Type of ride (normal/premium)


Testing scenarios

As base, let's create a single agency 'A' with regions 'ABCDE' and assign one driver 'John' with license '123' to it.

Repeating cases:
Wanted result -> inform the user about existing data and wait for a new input.