X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fsimulator%2Fsimulate.py;fp=judge%2Fsimulator%2Fsimulate.py;h=b44012b0397952591f017c6bba41cae8f9c1df3f;hp=b84a525d50ae8dc765b662f86da26ba506e4b743;hb=e1153eebe8cfd0c881cef2ff8fca63f130e736b3;hpb=de72851794e06d2e179799b95e1ea2955b9560b1;ds=sidebyside diff --git a/judge/simulator/simulate.py b/judge/simulator/simulate.py index b84a525..b44012b 100755 --- a/judge/simulator/simulate.py +++ b/judge/simulator/simulate.py @@ -27,6 +27,8 @@ baseDirectory = "../.." #Base directory for results, logs, agents nGames = 2 #Number of games played by each agent against each opponent. Half will be played as RED, half as BLUE. If nGames <= 1, then no games will be played (useful for dry run?) nRounds = 1 +timeoutValue = 2 + if len(sys.argv) >= 2: nRounds = int(sys.argv[1]) if len(sys.argv) >= 3: @@ -226,7 +228,7 @@ for roundNumber in range(totalRounds, totalRounds + nRounds): if verbose: sys.stdout.write("Agents: \""+red["name"]+"\" and \""+blue["name"]+"\" playing game (ID: " + gameID + ") ... ") logFile = logDirectory + "round"+str(roundNumber) + "/"+red["name"]+".vs."+blue["name"]+"."+str(gameID) - outline = os.popen(managerPath + " -o " + logFile + " " + red["path"] + " " + blue["path"], "r").read() + outline = os.popen(managerPath + " -o " + logFile + " -T " + str(timeoutValue) + " " + red["path"] + " " + blue["path"], "r").read() results = outline.split(' ') if len(results) != 6: