#NEWLINE# def update( self , timestamp , core_states ) : #NEWLINE# #INDENT# if ( self . last_timestamp is not None ) : #NEWLINE# #INDENT# delta = ( timestamp - self . last_timestamp ) #NEWLINE# active_cores = [ i for ( i , c ) in enumerate ( self . previous_states ) if ( c and ( clust_active_cores [ 0 ] == ( - 1 ) ) ) ] #NEWLINE# for ( cluster , cluster_cores ) in self . clusters . iteritems ( ) : #NEWLINE# #INDENT# clust_active_cores = len ( cluster_cores . intersection ( active_cores ) ) #NEWLINE# self . parallel_times [ cluster ] [ clust_active_cores ] += delta #NEWLINE# if clust_active_cores : #NEWLINE# #INDENT# self . running_times [ cluster ] += delta #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . first_timestamp = timestamp #NEWLINE# #UNINDENT# self . last_timestamp = timestamp #NEWLINE# self . previous_states = core_states