CSE2305 - Object-Oriented Software
Engineering
Assessment
For this assignment you are required to design and code a simple Train management system. The Piedmont Railway Company (P.R.C.) maintains a simple railway transport system. There are several different classes of rolling stock used by P.R.C.: Engines, carriages, wagons and cabooses. Carriages are normally fitted with seating and come in a number of different varieties: 1st class, 2nd class and diner cars. Wagons are used for the transport of general materials (e.g. timbre, livestock, etc.) P.R.C. uses two main types of engine: diesel and electric. Electric engines require overhead power on the train lines they travel on, where as Diesel engines do not (although they can run on lines with overhead power). Engines have a total load carrying capacity (measured in metric tonnes) which is the total weight the engine can move (including its own weight). The weight of carriages depends on the base carriage weight (different for each type of carriage - see table below) plus a "PAX load" equal to 100kg x the number of people on board. For dining cars the PAX load is 20% of the total passenger PAX transported up to a maximum of 5,000kg. Carriages also have a maximum carrying capacity. A Wagon's weight depends on the stock transported.
Stock | Base Weight (kg) | Max Load | Max carrying capacity | Journey Cost |
---|---|---|---|---|
Diesel Engine | 16,000kg | N/A | 500 Metric Tonnes | $100/km |
Electric Engine | 12,000kg | N/A | 300 Metric Tonnes | $150/km |
1st Class Carriage | 4,000kg | 40 PAX | N/A | $20/km + $180/passenger |
2nd Class Carriage | 3,000kg | 60 PAX | N/A | $10/km + $100/passenger |
Dinner Carriage | 5,000kg | 50 PAX | N/A | $8/km |
Caboose | 1,500kg | N/A | N/A | $4/km |
Wagon | 2,200kg | 30 Metric Tonnes | N/A | $18/km + $300/tonne |
P.R.C. maintains a fleet of rolling stock. Items of rolling stock are assembled into a train which makes a journey. Each train requires at least one engine (at the front) and a caboose (at the back). Any number of carriages, wagons and engines may be added, up to the total carrying capacity of the engines. It is anticipated that new stock may have different parameters than those shown in the table, so the figures should not be hard coded into any system.
Given a particular fleet configuration we are interested in a system that allows us to build trains suitable for a specified journey. The journey is specified with the following parameters:
The system is to have the following features:
Stock that is currently assigned to a particular journey cannot be used in another journey until after the journey is complete.
Any interaction with the system should be via a simple text interface. Make sure your system is able to handle errors correctly (e.g. insufficient fleet available to meet requested journey requirements).
Develop an object-oriented design for this system and implement it in C++.
You should submit the following:
Makefile
,
with 2 targets: the default target builds the program(s), the clean target
removes the executable and any intermediate (e.g. .o files created during
compilation). vi
).See the submit page for details on how to submit your assignment. Use the submission code "sup1" as the assessment code.
Last Modified: November 26, 2005