def _do_main_loop(self, iterations, dump_freq): start_time = time() log.info("Simulation start...") it = xrange(iterations // dump_freq) if self.pb: it = get_progressbar()(it) for i in it: self._do_iterations(dump_freq) self.dump_results((i + 1) * dump_freq) log.info("Simulation end. Total time: " + str(time() - start_time))
def gen_res(results, params, funs): start_time = time() logging.info("Calculating stats...") pb = get_progressbar() retv = [[x for f in funs for x in f(agents, params, it)] for it, agents in pb(results)] logging.info("Calculating stats finished. Total time: "+str(time()-start_time)) return retv