#NEWLINE# def taxi_process( ident , trips , start_time = 0 ) : #NEWLINE# #INDENT# 'Yield to simulator issuing event at each state change' #NEWLINE# time = ( yield Event ( start_time , ident , 'leave garage' ) ) #NEWLINE# for i in range ( trips ) : #NEWLINE# #INDENT# prowling_ends = ( time + compute_delay ( SEARCH_DURATION ) ) #NEWLINE# time = ( yield Event ( prowling_ends , ident , 'pick up passenger' ) ) #NEWLINE# trip_ends = ( time + compute_delay ( TRIP_DURATION ) ) #NEWLINE# time = ( yield Event ( trip_ends , ident , 'drop off passenger' ) ) #NEWLINE# #UNINDENT# ( yield Event ( ( time + 1 ) , prowling_ends , 'going home' ) )