SLIDE 1
CMPT-300 02-01 E2
Model Answer for Assignment 2
In a factory, there are 3 component makers. Each maker produces a unique kind
- f components independently. All these components are stored in a moving belt
with size 10 forwarding to the assemblers. Every two components of different kinds can be assembled into one product. Thus, there are in total 3 distinct kinds of products. Two screw drivers are needed to assemble a product. All screw drivers have same function. There are also 3 assemblers with same priority who are responsible for assembling the products using components. In total, there are 3 screw drivers. An assembler can only work on one product at a time. When an assembler gets both the components and screw drivers, she can assemble a product within a limited time varied from 0.01 second to 1 second. Otherwise, she has to wait until all the necessities are met. She can grab the components or screw drivers first. The order does not matter. However, she can only get one piece (component or screw driver) at one time. If an assembler decides to make another product before she starts to make the current product, she can put the components and screw drivers back and re-get the new components and screw drivers. But she has to put the screw drivers back right after she finishes a product, since other assemblers may need these screw drivers. A product is put into an unlimited product queue. An assembler cannot start a new product before she put the current product into the queue. Some restrictions apply to the products as follows.
- No same kind of products can be next to each other in the product queue.
- The difference of the number of any two kinds of products in the queue