Question: Im not sure how to approach this problem i am completely stuck. Here are the instructions: -Write psuedo code to solve the following programming problem
Im not sure how to approach this problem i am completely stuck.
Here are the instructions:
-Write psuedo code to solve the following programming problem using only semaphores and or shared memory
-Explain the usage of each semaphore in your pseudo code.
-Assume that all processes and shared resources have been previously instantiated and no deallocation is necessary, unless noted otherwise. Allow processes to execute with the maximum degree of concurrency, i.e., unless otherwise required by the problem, do not pause an execution of any process arbitrarily.
And here is the question:

2. A work area is divided into 6 regions: A0, A1, A2, B0, B1 & B2. The work area can be occupied some robots. Each of the robots is managed by a separate process. Assume that each robot is either in its work area/square or is in its base (outside the 6 squares), and that a robot can more freely in and out of the work area without interfering with other robots. A0 BO A1 B1 The following rules of work area must be observed: When one robot hen one B2 r,n As shown in the illustration, while one robot occupies square A0, another robot can occupy square B2. But, while one robot occupies square B0, 2 other robots may occupy squares A1 & B2 or 3 other robots may occupy squares A1, B1 & A2. The pseudo code defines the operations of each robot. RobotA RobotB 1. loop repeatedly 1. loop repeatedly 2. compute briefly occupy A return to base compute a little while occupy BO return to base calculate for a moment occupy BO return to base calculate a little more occupy B1 return to base 4 5. 6. 8. endloop 8. endloop RobotC RobotD 1. loop repeatedly 1. loop repeatedly await a shipment occupy A1 return to base await a 2nd shipment occupy B1 return to base occupy A return to base intermission to retool occupy B2 return to base download new instructions 4 5. 6. 8. endloop 8. endloop RobotE 1. loop repeatedly check inventory occupy A1 return to base do a quick calculation occupy A2 return to base 8. endloop 2. A work area is divided into 6 regions: A0, A1, A2, B0, B1 & B2. The work area can be occupied some robots. Each of the robots is managed by a separate process. Assume that each robot is either in its work area/square or is in its base (outside the 6 squares), and that a robot can more freely in and out of the work area without interfering with other robots. A0 BO A1 B1 The following rules of work area must be observed: When one robot hen one B2 r,n As shown in the illustration, while one robot occupies square A0, another robot can occupy square B2. But, while one robot occupies square B0, 2 other robots may occupy squares A1 & B2 or 3 other robots may occupy squares A1, B1 & A2. The pseudo code defines the operations of each robot. RobotA RobotB 1. loop repeatedly 1. loop repeatedly 2. compute briefly occupy A return to base compute a little while occupy BO return to base calculate for a moment occupy BO return to base calculate a little more occupy B1 return to base 4 5. 6. 8. endloop 8. endloop RobotC RobotD 1. loop repeatedly 1. loop repeatedly await a shipment occupy A1 return to base await a 2nd shipment occupy B1 return to base occupy A return to base intermission to retool occupy B2 return to base download new instructions 4 5. 6. 8. endloop 8. endloop RobotE 1. loop repeatedly check inventory occupy A1 return to base do a quick calculation occupy A2 return to base 8. endloop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
