示例#1
0
文件: grupy.py 项目: martaczc/grupy
 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))
示例#2
0
文件: analyzer.py 项目: mroja/cog-abm
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
示例#3
0
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