diff --git a/src/arenas/CSampleAgents.py b/src/arenas/CSampleAgents.py new file mode 100644 index 0000000000000000000000000000000000000000..a49d6dfc29870962e61f8c4343746a0f35ee164c --- /dev/null +++ b/src/arenas/CSampleAgents.py @@ -0,0 +1,11 @@ +'''CSampleAgents.py +An areana that runs the sample bots in C. +Written by Daniel Axtens <dja@ucc.asn.au> for the UCC Programming Competition in 2010. + +Licensed under an MIT-style license: see the LICENSE file for details. +''' + +from link.C.c_agents import c_angel, c_lucifer, c_streetfighter, c_frenchie + +class arena: + Agents = [c_angel,c_lucifer,c_streetfighter,c_frenchie] diff --git a/src/arenas/PythonSampleAgents.py b/src/arenas/PythonSampleAgents.py new file mode 100755 index 0000000000000000000000000000000000000000..c0c1134fb0c172438a2103f99b6a9d43041b47d5 --- /dev/null +++ b/src/arenas/PythonSampleAgents.py @@ -0,0 +1,14 @@ +#!/usr/bin/python2.5 +'''PythonSampleAgentsArena.py +An areana that runs the sample bots in python. +Written by Daniel Axtens <dja@ucc.asn.au> for the UCC Programming Competition in 2010. + +Licensed under an MIT-style license: see the LICENSE file for details. +''' + +from SampleAgents import Angel, Lucifer, Dummy, Frenchie, Streetfighter + + +# Import and add your agents here: +class PythonSampleAgentsArena: + Agents = [Angel,Lucifer,Streetfighter,Frenchie] \ No newline at end of file diff --git a/src/arenas/__init__.py b/src/arenas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/conf.py b/src/conf.py index 8ffbb2f2502ab8c5a164bbaf9f5732b358f45ab0..aabd7171395fe9f6214462284223594833b3241b 100644 --- a/src/conf.py +++ b/src/conf.py @@ -6,7 +6,7 @@ from rpsconst import * VERBOSE = True # Enable for even more verbose output. -DEBUG = True +DEBUG = False # How many iterations to run before quitting. MAX_ITERATIONS = 150 diff --git a/src/progcomp.xcodeproj/project.pbxproj b/src/progcomp.xcodeproj/project.pbxproj index 36086a89b8c33976f2f78ba08f73d090bc34b1b5..ca03935b7fd30746c09daa114d84eb2dbd8f8238 100644 Binary files a/src/progcomp.xcodeproj/project.pbxproj and b/src/progcomp.xcodeproj/project.pbxproj differ diff --git a/src/simulate.py b/src/simulate.py index d3afdf930b840c567a312d9e9aec03e76bb8294a..cdf6d86add47fafbcc842b37baf600b014a3cf0d 100755 --- a/src/simulate.py +++ b/src/simulate.py @@ -5,11 +5,9 @@ Written by Luke Williams <shmookey@ucc.asn.au> for the UCC Programming Competiti Licensed under an MIT-style license: see the LICENSE file for details. ''' -# Import and add your agents here: -#from link.C.c_agents import c_angel, c_lucifer, c_streetfighter, c_frenchie - -from SampleAgents import Angel, Lucifer, Dummy, Frenchie, Streetfighter -Agents = [Angel,Lucifer,Streetfighter,Frenchie] +# this is the default arena. To chose a different one - for example to run your +# own bots - use -a arenaName on the command line, or change this variable. +arenaName = "PythonSampleAgents" #################################### # Developers only past this point! # @@ -45,17 +43,24 @@ for i in range (1,len(sys.argv)): except: print usage sys.exit(1) - elif sys.argv[i] == "-v": VERBOSE = True + elif sys.argv[i] == "-a": + arenaName = sys.argv[i+1] + i += 1 + +#import the arena - NOTE THAT THIS IS A POTENTIAL SECURITY HOLE, +# AS INPUT IS NOT SANITY CHECKED! +importString = "from arenas." + arenaName + " import arena" +exec importString iteration = 0 trial = 0 winners = {} while trial < TRIALS: sup = Supervisor () - for Agent in Agents: sup.RegisterAgent (Agent) + for Agent in arena.Agents: sup.RegisterAgent (Agent) sup.GeneratePopulation (STARTING_POPULATION) trial += 1