This project is an implementation of a stowage plan for a container ship.
A stowage plan for container ships is the plan by which different types of container vessels are loaded with containers of specific standard sizes. The plans are used to maximize the economy of shipping and safety on board.
- Ship plan
A container ship has floors, starting with the lower floor, indexed zero. Each floor has a “plan” which is like a map of the floor. An upper floor may add new container spots that were not available in a lower floor, but it cannot remove spots that were available in a lower floor. We assume all containers are the same size and sit exactly one top of the other. The ship’s “plan” is the plan of all its floors. - Container
A container has the following properties:
Weight (kgs)
Destination port (5 english letters of seaport code)
Unique identifier (according to the ISO 6346 international standard) - Ship Route
A ship has a finite route, containing any number of destination ports. - Cranes operation
The dock cranes can pull any container if there is no other container on top of it. - Stowage Process
When a ship reaches a port, it unloads all the containers that should be unloaded at this location and loads all the containers that should be loaded to it.
- Special Global Types for ship: X, Y, Height
- Ship’s template parameter: typename Container
- Ship’s Constructors:
Ship(X x, Y y, Height max_height,std::vector<std::tuple<X, Y, Height>> restrictions,Grouping groupingFunctions)
Ship(X x, Y y, Height max_height,std::vector<std::tuple<X, Y, Height>> restrictions)
Ship(X x, Y y, Height max_height) - Loading container: void load(X x, Y y, Container c)
- Unloading container: Container unload(X x, Y y)
- Moving container from one place to another: void move(X from_x, Y from_y, X to_x, Y to_y)
- begin and end iterators iterating over all containers on the ship.
- The following functions return a "view" of the ship that can be iterated over using the begin and end iterators:
getContainersViewByPosition(X x, Y y)
getContainersViewByGroup(const string& groupingName, const string& groupName)