In this assignment you are to simulate a door-to-door transportation service that will deploy a fleet of driverless vehicles to pick up passengers and take them to their desired destination. You should start with your Assignment 2 travel network layer, modifying it to use exceptions for errors and alternative return values where appropriate, and add simulation objects that use activities and an activity manager to simulate the completion of the trips in the network. Your simulation should implement a set of basic functionality and some extensions of your choice. You are not required to use or support the InstanceManager layer in this assignment.
You are to extend your travel network to keep track of trips, where a trip is defined by a starting location, destination, and number of travelers. You also must extend the Vehicle entity type to add an attribute indicating a vehicle's current location.
You are to write simulation classes that use activities and an activity manager to simulate the completion of all the trips entered into the network. The service simulation can find a vehicle available and start an activity to send the vehicle to pick up the passengers and transport them to their destination.
Your service simulation should receive a notification when a trip is added to the network to initiate the process of finding a vehicle, transporting it to the passengers' location, and then transporting the passengers to their destination. The service simulation also should use notifications from your travel network API to keep track of what vehicles are available to use for transporting passengers.
For the basic functionality, you may assume the only vehicles in the network are cars, the only segments are roads, the only locations are residences, and every trip only has one passenger. You also may assume that a car travels at its defined speed at a constant rate along a segment from the source to the destination.
You should have the vehicle take the shortest path from the trip's starting location to the destination. You should also assign the vehicle that is closest to service a trip. You also must collect statistics on trips, including how many are in the network, how many have been completed, and the average (mean) time passengers wait to be picked up.
Write several applications that set up different simulation scenarios, varying number of locations, segments, vehicles, starting location of the vehicles, and trips. You may write a single application that reads the network setup from a data file, but such an approach is not required. Include the applications in your submission and describe the purpose of each application in your README file.
In addition to the basic functionality described above, you are required to experiment with some extensions to this simulation. This additional work will account for 1/3 of the assignment grade.
Post on Piazza (privately if your prefer, but being public is allowed and encouraged) ideas for extensions that you think would be interesting and you would like to do. You should work with Ali or Sudarshan to specify the details of what you plan to do.
Some possibilities include randomly generating new trips to run simulations over a long period of time and/or with a large number of trips, handling trips with multiple passengers that might require multiple vehicles, caching minimum paths between locations and updating the cache when the network changes, adding capacity and maximum speed attributes to a segment such that the trip route might optimize for shortest time instead of shortest distance, experimenting with different strategies of where vehicles should go after a trip is completed, and using deferred notifications and concurrency in your activities. You are not limited to this list, but you must get your extensions approved by a TA.
Submit the assignment using the /usr/class/cs249a/bin/submit program. Your submission must include the following: