Java task (assembly)

Job ID: 33906859

Budget: $30 – $60 USD

Problem description
For this task we will consider a simulation of the assembly line of a computer factory.
In our extremely simplified scenario, the shop will use a few elementary hardware components to produce different types of machines (initially: basic PCs, and high-performance workstations). The hardware components will be contained in dedicated storage shelves, that are periodically refilled. Once all necessary components for a specific machine type are present in the storage, the machine may be assembled and then placed on the packaging line, ready to be sold, as shown in the following picture:
Each hardware component has an associated cost, and the cost of the assembled machine is given by the sum of the costs of its components, plus the cost of packaging. The time it takes to assemble a machine is directly proportional to its cost1.
There are a few restrictions characterising the operations of the factory:
• the storage shelves have limited space: when they become full, no additional components may be received unless some are taken out first;
• no machine can be assembled unless the required amount of all of its components is present in storage;
• in order to maximise profits, the sales department of the factory has imposed policy that requires machines
with higher cost to be sold first, regardless of the order in which they are produced.
The simulation program needs to be parametric, so for instance MAX_STORAGE_SIZE indicates the maximum number of components each of the storage shelves can hold. An initial choice for the parameters will be provided in the code (see file Parameters.java), but your program needs to work for any meaningful choice for the parameters.
The required components for assembling each of the machines produced by the factory are as follows: PC : 1 Motherboard + 1 GPU + 2 RAM + packaging
Workstation : 1 Motherboard + 1 GPU + 4 RAM + packaging
1 You can assume that the time to assemble a machine (in ms) is exactly equal to its cost.

You can assume that the material for packaging is always available at the factory (no need for generating or storing it).
Finally, the table below provides details about the hardware components and their characteristics:
Part Cost
Motherboard 50
RAM GPU
10 20
This coursework is composed of two tasks, each worth 50% of the entire module assessment mark. The remainder of this document contains a description for the two tasks, and the instructions about how to access the starting code and how to submit your work.
Task1: Code design [50%]
The goal of this task is to implement the basic data structures to simulate the production flow of the computer factory, and to generalise its behaviour. You are free to choose any library class you deem suitable, as long as you meet the requirements. In particular, note that the storage shelves are constrained to hold a maximum of MAX_STORAGE_SIZE components each.
Finally, you will need to implement an appropriate data structure to hold packaged items waiting to be sold. We are not imposing any limit on the size of this data structure, but it must guarantee that more expensive items are extracted first, regardless of the order they were added to the data structure.
Expected task outcome
The goals for this task are:
1. the creation of the new Laptop type of machine to be produced;
2. the creation of a DeluxeComputer class to simulate “deluxe” packaging;
3. the implementation of the package queue to account for the priority to be given to higher-cost machines.