--- /dev/null
+'''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]
--- /dev/null
+#!/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
VERBOSE = True
# Enable for even more verbose output.
-DEBUG = True
+DEBUG = False
# How many iterations to run before quitting.
MAX_ITERATIONS = 150
objects = {
/* Begin PBXFileReference section */
+ 228D541011DB3CEB00258478 /* PythonSampleAgents.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = PythonSampleAgents.py; sourceTree = "<group>"; };
+ 228D541311DB443B00258478 /* CSampleAgents.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CSampleAgents.py; sourceTree = "<group>"; };
22CA010611D9BD51001ECDEF /* bundle-agent.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "bundle-agent.sh"; path = "link/bundle-agent.sh"; sourceTree = "<group>"; };
22CA010711D9C52B001ECDEF /* cAgent.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = cAgent.py; path = link/cAgent.py; sourceTree = "<group>"; };
22CAFEEA11D84076001ECDEF /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
22CAFEEE11D84076001ECDEF /* selectAlgorithms.py */,
22CAFEEF11D84076001ECDEF /* simulate.py */,
22CAFEF011D84076001ECDEF /* uccProgComp.py */,
+ 228D540F11DB3CEB00258478 /* arenas */,
);
name = progcomp;
sourceTree = "<group>";
};
+ 228D540F11DB3CEB00258478 /* arenas */ = {
+ isa = PBXGroup;
+ children = (
+ 228D541011DB3CEB00258478 /* PythonSampleAgents.py */,
+ 228D541311DB443B00258478 /* CSampleAgents.py */,
+ );
+ path = arenas;
+ sourceTree = "<group>";
+ };
22CAFF7711D840CB001ECDEF /* link */ = {
isa = PBXGroup;
children = (
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! #
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