Final project in Advanced Topics in Object-Oriented Programming
Description:
This project deals with the time-dependent simulation of vessels and is designed to use the Controller-View-Model paradigm.
Objects:
-
Port:
This is a simulation object with a fixed location and fuel reservoirs (without storage limit), and it is the responsibility of unloading, loading, and refueling a vessel. -
Ship:
This is an object that can travel between ports and can load and unload containers in every port; every ship has a fuel tank and moves at a specific speed.
Types of ships :- Freighter:
This vessel transports containers (from port to port, according to the loading and unloading orders, and cruises at a given speed from point to point subject to regular fuel consumption. Fill its cargo capacity to the maximum number of containers and aim to fill the fuel tank (depending on the existing fuel inventory in the port.) The creation of the ship occurs during the simulation. - Patrol_boat:
This vessel patrols between the various ports in the maritime space anchor in them, and complete a return route to the point of departure. The creation of the ship occurs during the simulation. - Cruiser:
This vessel attacks and robs cargo ships or attacks patrol ships; It is not allowed to dock in ports. The creation of the ship occurs during the simulation.
- Freighter:
-
Model:
This is a single object which is required to be defined in the Singleton format; It is his responsibility to monitor the world of simulation in all its aspects, from time management to object storage. In particular, it must hold using pointers all the vessels and ports participating in the simulation, and provide access services to them. In addition, the object is responsible for providing update services for the view object. -
View:
This object has one responsibility and is to display the world map using ASCII-based graphics.Each object is represented on the map by the first two characters of its name. The information update is based on interaction with the model. -
Controller:
This is a single object whose responsibility is to manage the interaction with the user and to route the inputs obtained for the model. This warranty also includes the management of errors in the user inputs.
All the commands are defined in the file src/Controller.CPP (void Controller::run())
In the input&output console, there are some examples of the I/O.