C++ code for simulation

let MC be the master clock and let R indicate whether
the repairman is busy or idle. We assume that at time zero all three machines are operational and that CL1=1, CL2=4, CL3=9. (These are known as initial conditions.)

A hand simulation - three machines
– Operational time = 10, and repair time = 5 units of time.
– CL1, CL2, CL3 are associated with machines 1, 2, 3
– CL4 repairman’s completion time
– At t=0 all three machines are operational, CL1=1, CL2=4, CL3=9

when first machine arrive in the queue server is empty and it provide services to the break down machine similarly this with other machines..
CL1 and CL2 and CL3 are the breakdown time when machine gets breakdown and CL4 is the departure time when machine got repaired and then new machine arrive for repair .
R stands for repairman busy or idle in repairing machines

here is the table

MC CL1 CL2 CL3 CL4 n R
0 1 4 9 - 0 idle
1 - 4 9 6 1 busy
4 - - 9 6 2 busy
6 16 - 9 11 1 busy
9 16 - - 11 2 busy
11 16 21 - 16 1 busy
16 - 21 26 21 1 busy

i need to code this program.. kindly help me in its codding and making the logic write.

Write a computer program to simulate the machine interference problem as described in section 1.3.1. Each time an event occurs, print out a line of output to show the current values of the clocks and of the other status parameters (as in the hand simulation). Run your simulation until the master clock is equal to 20. Check by hand whether the simulation advances from event to event properly, and whether it updates the clocks and the other status parameters correctly.
Topic archived. No new replies allowed.