Simulation of a subway train.
- Creates a train to operate for
N
stations. - Begins train operation.
- Prints statistics about train operation.
$ make clean
$ make
Command line arguments are optional.
$ ./train_simulation <Total Stations> <Total Waggons> <Max Capacity of Each Waggon> <Full Fine> <Reduced Fine>
There are three classes: Passenger, Waggon and Train.
-
Waggon: Seats of Passengers are represented as an array of pointers to Passengers. This choice was made, because the size of the array is fixed, so a vector was not needed.
-
Train: Waggons are represented as an array of pointers to Waggons. This choice was made, because the size of the array is fixed, so a vector was not needed.