write my assignment 6005

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))

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))

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"

Comments are closed.

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp