parameters: ()
docstring: Performs a simulation, including network construction
docstring_summary: Performs a simulation, including network construction
docstring_tokens: Performs a simulation including network construction
function: def run_simulation():
      """Performs a simulation, including network construction"""
  
      # open log file
      with Logger(params['log_file']) as logger:
  
          nest.ResetKernel()
          nest.set_verbosity(M_INFO)
  
          logger.log(str(memory_thisjob()) + ' # virt_mem_0')
  
          sr = build_network(logger)
  
          tic = time.time()
  
          nest.Simulate(params['presimtime'])
  
          PreparationTime = time.time() - tic
  
          logger.log(str(memory_thisjob()) + ' # virt_mem_after_presim')
          logger.log(str(PreparationTime) + ' # presim_time')
  
          tic = time.time()
  
          nest.Simulate(params['simtime'])
  
          SimCPUTime = time.time() - tic
  
          logger.log(str(memory_thisjob()) + ' # virt_mem_after_sim')
          logger.log(str(SimCPUTime) + ' # sim_time')
  
          if params['record_spikes']:
              logger.log(str(compute_rate(sr)) + ' # average rate')
  
          print(nest.kernel_status)
function_tokens: def run_simulation ( ) : # open log file with Logger ( params [ 'log_file' ] ) as logger : nest . ResetKernel ( ) nest . set_verbosity ( M_INFO ) logger . log ( str ( memory_thisjob ( ) ) + ' # virt_mem_0' ) sr = build_network ( logger ) tic = time . time ( ) nest . Simulate ( params [ 'presimtime' ] ) PreparationTime = time . time ( ) - tic logger . log ( str ( memory_thisjob ( ) ) + ' # virt_mem_after_presim' ) logger . log ( str ( PreparationTime ) + ' # presim_time' ) tic = time . time ( ) nest . Simulate ( params [ 'simtime' ] ) SimCPUTime = time . time ( ) - tic logger . log ( str ( memory_thisjob ( ) ) + ' # virt_mem_after_sim' ) logger . log ( str ( SimCPUTime ) + ' # sim_time' ) if params [ 'record_spikes' ] : logger . log ( str ( compute_rate ( sr ) ) + ' # average rate' ) print ( nest . kernel_status )