I cant figure out how to structure my function. def run_sim(lanes, capacity, block_lanes, block_time, rnd_gen) : time = 0 curr_wait = 0 while…
I cant figure out how to structure my function. Please help!
def run_sim(lanes, capacity, block_lanes, block_time, rnd_gen) :
time = 0
curr_wait = 0
while curr_wait > 0 :
curr_wait += 1
time += 1
arrive = lanes * rnd_gen.next_arrival()
depart = capacity
curr_wait = calc_waiting(arrive, depart, curr_wait)
if time <= block_time:
time += 1
curr_wait = calc_waiting(arrive, depart, curr_wait)
leave = capacity * (lanes – block_lanes)
if time > block_time:
curr_wait = calc_waiting(arrive, depart, curr_wait)
time += 1
curr_wait = curr_wait – capacity
leave = lanes * capacity
print(sim_line(time, arrive, leave, curr_wait))

How it Works

1
It only takes a couple of minutes to fill in your details, select the type of paper you need (essay, term paper, etc.), give us all necessary information regarding your assignment.


2
Once we receive your request, one of our customer support representatives will contact you within 24 hours with more specific information about how much it'll cost for this particular project.


3
After receiving payment confirmation via PayPal or credit card – we begin working on your detailed outline, which is based on the requirements given by yourself upon ordering.


4
Once approved, your order is complete and will be emailed directly to the email address provided before payment was made!