Project - Taxi Agency

University/WUT/EOOP/Preliminary Project - Basics
University/WUT/EOOP/Project Whitepaper

Classes

Agency

Agency has a set area of operation, on which the drivers can operate.
Drivers and trips are saved in a vector.
The addition of a new trip automatically increments the revenue

Driver

A driver can operate in multiple agencies, but the agency sets areas it operates in. If agency A operates in reg1 and reg2, agency B operates in reg2 and reg3, he cannot make the trip from reg1 to reg3 on one agency - the change of agencies is needed (which will be cheaper than using two separate drivers starting fee).
The addition of a trip automatically increases the revenue.
The areas of operation includes a map - known prices for passing between the regions (can be easily used for DFS this way)

Customer

Contents:

When requesting a ride, the customer chooses origin region and destination region, based on which he is given 3 best offers of prices every region has a time it takes to travel through. From that selection, the driver and agencies are assigned automatically, the payment is made and the drive proceeds.

Trip

ID is saved in a format X12345, where X is the agency id letter and 12345 is the number of the ride (incremented from the agency last ride).


!Preliminary Project Map


Request ride - Customer

findDrivers()


Map - graph

vertices - regions
edges - connecting neighbouring regions, weighted by time

Before pathfinding
create a submap (for every driver) using only the regions which the driver operates on

DFS/BFS/Dijkstra will check the best way from reg. A to reg. B
get time of the travel (from edges)
calculate the price -> starting + regions fare

Find the price
get the go-through regions using Dijkstra
for each region jump (road):
find which agencies (that Driver works in) operate that road
if two or more agencies -> get smallest price
sum the price


To-Do

Fix assignment of agencies to moves:
calculating which agency should earn from what moves
assigning correct agencies to the trip

Make a vector of pair <agency_id, revenue> and fill it while calculating the price -> agencies.insert(used_agency), revenue[agency] += cost / 2;

Destructors
fail-saves