Question: Software i Use is Python Requirement 1a (20pts): In the current code each job has an equal probability of being added to the que, but

Software i Use is Python  Software i Use is Python Requirement 1a (20pts): In the current
code each job has an equal probability of being added to the
que, but this does not reflect the situation at Inentech. Modify the

Requirement 1a (20pts): In the current code each job has an equal probability of being added to the que, but this does not reflect the situation at Inentech. Modify the code so that when a job is added to the que the probability of each type of job being added to the que is Job Probability as a Percentage Build 50% Repair 15% Maintenance 30% Disassemble 5% Hints: yqu could generate a random number from 1 to 100 and use an if/elifelse statement to see which job is generated if 50 or less Build, elif 65 or less Repair, eli,95 or less Maintenance Requirement 1b (14pts): The code for requirement la that randomly picks the job according to the table must be implemented as a function named GenerateJob (). Replace the existing line of code que que + [jobs [random.randint(0,3)]] with que - Generate Job (que). Tips: Remember to have your function return the list que with the selected job concatenated to the end of Page 1 of 5 it. To concatenate a list and a string, you have to turn the string into a list by putting brackets around it. Also remember that you must define your function before you call it in your code. Requirement 2 (33pts): In the current code the passage of time is represented by steps in the simulation. In each step, there is a 25% percent chance that the worker will complete a job, but this does not reflect the actual situation at Inentech. You must modify the code so that the probability of completing a job corresponds to what is shown on the following table Job Probability if it is the first step Probability for that the worker works on the subsequent steps job 100 709 Requirement 2 (33pts): In the current code the passage of time is represented by steps in the simulation. In each step, there is a 25% percent chance that the worker will complete a job, but this does not reflect the actual situation at Inentech. You must modify the code so that the probability of completing a job corresponds to what is shown on the following table Job Probability if it is the first step Probability for that the worker works on the subsequent steps job Build 40% 70% Repair 80% 40% Maintenance 80% 90% Disassemble 50% 50% Hints: you can check to see what type of job is being worked on in the while loop using que [j1. You can check to see if this is a new job by checking the value of que_track (1), each step in which the worker works on a job, the corresponding value of que_track[j] is increased by one, by checking it's value you can see if this is the first step in which the worker has tried to do the job. You will need to use nested if statements of the form if que [5] "Build": if que_track)] = 1: #add code to check if the new job probability is met else: #add code to check if the existing job probability is met Elif quet) "Repair": and so on. What needs to happen in the job probability is met, that is to say if the job is completed? The code above would replace these lines of code if random.randint(0,100)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!