def initializationCode (mazeWidth, mazeHeight, mazeMap, timeAllowed, playerLocation, opponentLocation, coins) : t0 = time.time() # First we protect ourself from killing connard.preventFromKilling () # We add global variables global METAGRAPH global BESTPATHES global FORMICMETAGRAPH global GLOBALPATH global ACTUALPATH global GOALLOCATION # Let's define global variables METAGRAPH, BESTPATHES = th.generateMetaGraph(mazeMap, playerLocation, coins) GOALLOCATION = playerLocation t1 = time.time() # ut.timeline ("Computed meta-graph and best pathes", t0, t0, t1) # Now let's send a looooot of ants FORMICMETAGRAPH = aco.generateFormicMetaGraph (METAGRAPH, playerLocation, (timeAllowed-(t1-t0))*PERCENTTIMEALLOWEDFORANTSBEGINNING) t2 = time.time()
def initializationCode (mazeWidth, mazeHeight, mazeMap, timeAllowed, playerLocation, opponentLocation, coins) : global METAGRAPH global BESTPATHS iniTime = time.time() METAGRAPH, BESTPATHS = th.generateMetaGraph(mazeMap, playerLocation, coins) api.debug(time.time() - iniTime) return "Everything seems fine, let's start !"
def initializationCode(mazeWidth, mazeHeight, mazeMap, timeAllowed, playerLocation, opponentLocation, coins): global METAGRAPH global BESTPATHS iniTime = time.time() METAGRAPH, BESTPATHS = th.generateMetaGraph(mazeMap, playerLocation, coins) api.debug(time.time() - iniTime) return "Everything seems fine, let's start !"