From f3b1a5c26bb9362a9cd507a5d749df98231d5463 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Tue, 24 Aug 2010 16:34:58 +0800 Subject: [PATCH] small bugfix --- src/progcomp.xcodeproj/project.pbxproj | 2 ++ src/simulate.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/progcomp.xcodeproj/project.pbxproj b/src/progcomp.xcodeproj/project.pbxproj index ca03935..7d4f271 100644 --- a/src/progcomp.xcodeproj/project.pbxproj +++ b/src/progcomp.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 22CAFEF011D84076001ECDEF /* uccProgComp.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = uccProgComp.py; sourceTree = ""; }; 22CAFF7B11D840E3001ECDEF /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = __init__.py; path = link/__init__.py; sourceTree = ""; }; 22CAFF7C11D840E3001ECDEF /* externAgent.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = externAgent.py; path = link/externAgent.py; sourceTree = ""; }; + 22DB7DF31223BAF700E04CAB /* conf.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = conf.py; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXGroup section */ @@ -31,6 +32,7 @@ 22CAFEEB11D84076001ECDEF /* README */, 22CAFEEC11D84076001ECDEF /* rpsconst.py */, 22CAFEED11D84076001ECDEF /* SampleAgents.py */, + 22DB7DF31223BAF700E04CAB /* conf.py */, 22CAFEEE11D84076001ECDEF /* selectAlgorithms.py */, 22CAFEEF11D84076001ECDEF /* simulate.py */, 22CAFEF011D84076001ECDEF /* uccProgComp.py */, diff --git a/src/simulate.py b/src/simulate.py index cdf6d86..438a49e 100755 --- a/src/simulate.py +++ b/src/simulate.py @@ -21,7 +21,7 @@ usage = "Usage: rps [-v] [-i iterations=150] [-n starting_populations=10] [-t tr for i in range (1,len(sys.argv)): if sys.argv[i] == "-i": try: - maxIterations = int(sys.argv[i+1]) + MAX_ITERATIONS = int(sys.argv[i+1]) i += 1 continue except: @@ -37,7 +37,7 @@ for i in range (1,len(sys.argv)): sys.exit(1) elif sys.argv[i] == "-t": try: - trials = int(sys.argv[i+1]) + TRIALS = int(sys.argv[i+1]) i += 1 continue except: @@ -81,7 +81,7 @@ while trial < TRIALS: else: winners[winner[0]] = 1 #print "Winner: %s" % winner[0] -print "SCOREBOARD OVER %d TRIALS OF %d ROUNDS EACH" % (trials, maxIterations) +print "SCOREBOARD OVER %d TRIALS OF %d ROUNDS EACH" % (TRIALS, MAX_ITERATIONS) rawscoreboard = sorted ( [(score,player) for (player,score) in winners.items ()] , reverse=True ) scoreboard = [] for score, player in rawscoreboard: -- 2.20.1