Question
This part generates a random workload and saves it to a file. The output file should have the following structure PID Arrival Time CPU Burst
This part generates a random workload and saves it to a file. The output file should have the following structure PID Arrival Time CPU Burst IO Burst CPU Burst IO Burst CPU Burst 0 0 20 15 30 40 10 1 5 10 40 10 2 2 50 100 30 200 25 100 30 3 0 5 20 3 17 8 22 4 55 9 Each line in the file represents a process with a unique PID. All other numbers should be randomly generated from a range that is specified by the user. The generator should take the following parameters to generate the workload: - Number of processes: an integer value that specifies the number of generated processes. - Max arrival time: an integer value specifies the maximum arrival time. The arrival time of the processes should be randomly chosen from the interval [0, Max arrival time]. - Max No. of CPU Burst: an integer value that specifies the max number of CPU bursts for any process. The number of CPU burst for each process should be randomly generated from the range [1, Max No. CPU Burst]. Between the CPU burst you should insert IO bursts. However, note that the first and last bursts in any process must be CPU Burst. - [Min IO, Max IO]: The range for the IO burst duration, which should be randomly generated. - [Min CPU, Max CPU]: The range for the CPU burst duration, which should be randomly generated. The generated workload should be saved to a file, which can be then used as input for the simulator.
i need a code in java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started