-
May 19th, 2010, 01:50 PM
#1
coding challenge
There is a factory production line around a single a conveyor belt.
Components (of type A and B) come onto the start of the belt at random
intervals; workers must take one component of each type from the belt
as they come past, and combine them to make a finished product.
The belt is divided into fixed-size slots; each slot can hold only one
component or one finished product. There are a number of worker
stations on either side of the belt, spaced to match the size of the
slots on the belt, like this (fixed-width font ASCII pic):
v v v v v workers
---------------------
-> | A | | B | A | P | -> conveyor belt
---------------------
^ ^ ^ ^ ^ workers
In each unit of time, the belt moves forwards one position, and there
is time for a worker on one side of each slot to EITHER take an item
from the slot or replace an item onto the belt. The worker opposite
them can't touch the same belt slot while they do this.
(So you can't have one worker picking something from a slot while
their counterpart puts something down in the same place).
Once a worker has collected one of both types of component, they can
begin assembling the finished product. This takes an amount of time,
so they will only be ready to place the assembled product back on the
belt on the fourth subsequent slot. While they are assembling the
product, they can't touch the conveyor belt. Workers can only hold
two items (component or product) at a time: one in each hand.
Create a simulation of this, with three pairs of workers. At each
time interval, the slot at the start of the conveyor belt should have
an equal (1/3) chance of containing nothing, a component A or a
component B.
Run the simulation for 100 steps, and compute how many finished
products come off the production line, and how many components of each
type go through the production line without being picked up by any
workers.
Implementation in C or C++?
-
May 19th, 2010, 02:23 PM
#2
Re: coding challenge
That actually sounds like a funny little exercise if combined with some animation.
Anyway, the bitter reality is that since I don't have any deadline to meet as you have you probably will beat me to it. Looking forward to see the final result though.
-
March 2nd, 2016, 02:13 AM
#3
Re: coding challenge
totally agree with sma i would be a really appealing if you could put some animation along with it, still if you seek some help you can contact these people conveyor belt rubber hope they might be able to help you out. thanks
-
April 10th, 2018, 07:04 AM
#4
Re: coding challenge
Hi ,
If you have the solution please share the link.
Thanks
Originally Posted by tuderplank
There is a factory production line around a single a conveyor belt.
Components (of type A and B) come onto the start of the belt at random
intervals; workers must take one component of each type from the belt
as they come past, and combine them to make a finished product.
The belt is divided into fixed-size slots; each slot can hold only one
component or one finished product. There are a number of worker
stations on either side of the belt, spaced to match the size of the
slots on the belt, like this (fixed-width font ASCII pic):
v v v v v workers
---------------------
-> | A | | B | A | P | -> conveyor belt
---------------------
^ ^ ^ ^ ^ workers
In each unit of time, the belt moves forwards one position, and there
is time for a worker on one side of each slot to EITHER take an item
from the slot or replace an item onto the belt. The worker opposite
them can't touch the same belt slot while they do this.
(So you can't have one worker picking something from a slot while
their counterpart puts something down in the same place).
Once a worker has collected one of both types of component, they can
begin assembling the finished product. This takes an amount of time,
so they will only be ready to place the assembled product back on the
belt on the fourth subsequent slot. While they are assembling the
product, they can't touch the conveyor belt. Workers can only hold
two items (component or product) at a time: one in each hand.
Create a simulation of this, with three pairs of workers. At each
time interval, the slot at the start of the conveyor belt should have
an equal (1/3) chance of containing nothing, a component A or a
component B.
Run the simulation for 100 steps, and compute how many finished
products come off the production line, and how many components of each
type go through the production line without being picked up by any
workers.
Implementation in C or C++?
-
April 14th, 2018, 02:44 PM
#5
Re: coding challenge
Originally Posted by rajeshkumar1984
Hi ,
If you have the solution please share the link.
Thanks
Since the the op posted this single question 8 years ago and hasn't been back since, it is unlikely that he will return to give an answer. Probably best to solve homework questions yourself. Students that do this usually end up finding jobs and success; those that don't, well...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|