5 jobs start at node 1, and you generate a random number 0-100 for each job. That random number is attached to each job as the time it will take to run that job.
You then sort the jobs by the amount of time it will take to run from smallest to largest.
There is a clock variable that keeps track of how long your jobs have been running.
You start running the program and each job will deposit its “time” (random number from 0-100) into the clock variable.
When you deposit let’s say job 1’s time into the clock, you move it to the next node (node 2).
Then every time the clock variable reaches over 500, 1000, 1500, etc (every 500 “time” units) it will output where the jobs are (which nodes they are located in). It’s not real nodes you just assign a job with a number from 1-5 whenever you deposit its “time” into the clock.
Then when the clock reaches 10000 “time units” the loop stops.