Hello, I've got a problem that I can't seem to figure out. I'm writing a program to simulate a process manager, and I'm doing four different algorithms: First come first serve, shortest job next, shortest remaining time, and round robin. I've got the first two down perfect, but I'm having trouble with shortest remaining time.
So I've got two lists:
arrive=[0,3,6,7,7,10,15,16]
exe=[12,3,11,1,4,5,20,7]
"arrive" is the arrival time of a job and "exe" is the execution duration. I can only process one job at a time, and for this algorithm the processor is allocated to the job closest to completion (as long as it has arrived).
So, for example, in my lists, a job arrives at time 0 with a duration of 12. Now, I would only process it for 3 times through because the next job arrives at 3 and it has a shorter execution duration.
Hopefully that makes sense. Basically I just need help setting something up. I've been adding the arrived items to their own list, with their execution duration in another. I can post my code for the other algorithms if it would help anyone. I could also post any code for this algorithm that I've attempted. Thanks!!!!