more documentation and some cleanup
authorDaniel Axtens <[email protected]>
Thu, 9 Sep 2010 13:05:54 +0000 (21:05 +0800)
committerDaniel Axtens <[email protected]>
Thu, 9 Sep 2010 13:05:54 +0000 (21:05 +0800)
doc/HOWTO.txt
doc/JUDGING.txt
doc/WELCOME.txt
issues.txt
proposal.txt [deleted file]
src/README [deleted file]
src/README.txt [new file with mode: 0644]
src/link/Mathematica/pyml.tar.gz [deleted file]
src/link/Mathematica/pythonika-1.0.tar.gz [deleted file]
src/selectAlgorithms.py [deleted file]

index b816965..bce6373 100644 (file)
@@ -7,42 +7,68 @@ If you get stuck at any point, consult, in this order:
 
 === Setting up a development environment ===
 
-The ProgComp will work best for those running Mac OS X or Linux, but Windows is also supported.
+The ProgComp will work best for those running Mac OS X or Linux, but 
+Windows is also supported.
 
-All competitors will need Python, a modern, object-oriented scripting languages. Python comes pre-installed on Mac OS X and modern Linuxes - Windows users must download it from http://www.python.org/download/releases/2.7/
+All competitors will need Python, a modern, object-oriented scripting 
+languages. Python comes pre-installed on Mac OS X and modern Linuxes - 
+Windows users must download it from 
+http://www.python.org/download/releases/2.7/
 
-Then software you'll then need depends on the language in which you wish to program. The most up-to-date details, including some useful links, can be found at http://progcomp.ucc.asn.au/FAQs under "What software do I need to enter?"
+Then software you'll then need depends on the language in which you wish 
+to program. The most up-to-date details, including some useful links, 
+can be found at http://progcomp.ucc.asn.au/FAQs under "What software do 
+I need to enter?"
 
-Set up the relevant software now - we'll assume you have it working in the rest of this document.
+Set up the relevant software now - we'll assume you have it working in 
+the rest of this document.
 
 === Trying out the sample agents ===
 
 Full sample code is supplied for all the supported languages.
 
-Pull up a terminal/command line prompt. Change directory to the src/ subfolder (*nix path conventions will be used throughout) and type "python simulate.py -v"
+Pull up a terminal/command line prompt. Change directory to the src/ 
+subfolder (*nix path conventions will be used throughout) and type 
+"python simulate.py -v"
 
-You should see some output as "Angel", "Lucifer", "Streetfighter" and "Wash", the 4 sample agents, battle it out. If you an error is raised, well, that's a bit awkward. It's probably due to your python installation - check that, check the FAQs, then google the error message, then if none of that works, contact us.
+You should see some output as "Angel", "Lucifer", "Streetfighter" and 
+"Wash", the 4 sample agents, battle it out. If you an error is raised - 
+well, that's a bit awkward. It's probably due to your python 
+installation - check that, check the FAQs, then google the error 
+message, then if none of that works, contact us.
 
-If you're using Python, take some time to poke around at SampleAgents.py, then skip to the next section.
+If you're using Python, take some time to poke around at 
+SampleAgents.py, then skip to the next section.
 
-If you're using C/C++, Java or MATLAB, follow the instructions in the src/link/<language> directory to get those agents running. Again, if something goes wrong, check the documentation, the FAQ, Google, and then if still stumped, contact us.
+If you're using C/C++, Java or MATLAB, follow the instructions in the 
+src/link/<language> directory to get those agents running. Again, if 
+something goes wrong, check the documentation, the FAQ, Google, and then 
+if still stumped, contact us.
 
-Take some time to poke around at the sample code and get a handle on what's going on and how it works.
+Take some time to poke around at the sample code and get a handle on 
+what's going on and how it works.
 
 === Making your own ===
 
-Here's where you have to do the thinking. Your agent must consist of a single source file, and provide the same function definitions as the sample agents. 
+Here's where you have to do the thinking. Your agent must consist of a 
+single source file, and provide the same function definitions as the 
+sample agents.
 
-<<standardise location for agents?>>
-Put your code in the "agents/"
-
-Information about creating the relevant python wrapper script to allow your program to interface with the supervisor should be provided with the sample code for your language.
-<<FIXME>>
+Consult the documentation for each language to see how to write an agent 
+in your language of choice. Start in the "src" directory.
 
 === Submitting your own agent ===
 
-Procedures for submitting your own agent will be released by email and on the website soon. Stay tuned.
+Procedures for submitting your own agent will be released by email and 
+on the website soon. Stay tuned.
 
-Submitting your agent is not the end of the fun, either. All going well*, there should be a running leaderboard, so you can watch your agent compete, if you wish, or you can keep its runnings secret until the final judgement.
+Submitting your agent is not the end of the fun, either. All going 
+well*, there should be a running leaderboard, so you can watch your 
+agent compete, if you wish, or you can keep its runnings secret until 
+the final judgement.
 
-* This includes the organiser not dying of a caffeine overdose or developing a psychiatric injury as a result of overloading and co-ordinating. Your mileage may vary. UCC members may donate to the coke account 'dja' if they wish to keep me supplied with coke and pizza during this time.
\ No newline at end of file
+* This includes the organiser not dying of a caffeine overdose or 
+developing a psychiatric injury as a result of overloading and 
+co-ordinating. Your mileage may vary. UCC members may donate to the coke 
+account 'dja' if they wish to keep me supplied with coke and pizza 
+during this time.
index 87ecdd6..7d7fc75 100644 (file)
@@ -1,22 +1,31 @@
-JUDGING.txt: An insight into the capricious and arbitrary mind of the organiser on how your agent will be judged.
+JUDGING.txt: An insight into the capricious and arbitrary mind of the 
+organiser on how your agent will be judged.
 
-<<FIXME: check this is accurate and OK to publish>>
-
-IN SUMMARY: write clean, efficient, portable, smart code that just does what it's told and doesn't try to do anything it shouldn't. Don't rely on *anything* not expressed in sample code, or preferably, documentation. If in doubt, ask. 
+IN SUMMARY: write clean, efficient, portable, smart code that just does 
+what it's told and doesn't try to do anything it shouldn't. Don't rely 
+on *anything* not expressed in sample code, or preferably, 
+documentation. If in doubt, ask.
 
 THINGS NOT TO DO:
  - Inline assembler.
  - Deliberately obfuscated code.
- - Attempts to communicate between bots.
+ - Attempts to communicate between agents (other than by known sequences 
+of bluffs/attacks).
  - File, network or system access.
 
 Other points:
 
-There are lots of divisions. Each division has its own prizes. How many divisions there are, and what the prizes are, depends on how much we get sponsored, and how creative I am at the time.
+There are lots of divisions. Each division has its own prizes. How many 
+divisions there are, and what the prizes are, depends on how much we get 
+sponsored, and how creative I am at the time.
 
-Be honest in the divisions you sign up for, and don't play silly games. Trying to break the software, security, machines, my mind, etc., are all frowned upon and may result in instant disqualification, etc., as laid out in the rules.
+Be honest in the divisions you sign up for, and don't play silly games. 
+Trying to break the software, security, machines, my mind, etc., are all 
+frowned upon and may result in instant disqualification, etc., as laid 
+out in the rules.
 
 To win the most prizes:
- - Allow your agent to be run on the scoreboard: I might give a prize to top-of-the-ladder agents.
- - Make your agent as fast and efficient as possible - there might be *lots* of instances.
- - Don't rely on points tables too much. I am interested in how agents perform in different situations - like a zero sum arena for example. If I ever get around to looking at this I will make it possible for your agent to query the points table.
+ - Allow your agent to be run on the scoreboard: I might give a prize to 
+top-of-the-ladder agents.
+ - Make your agent as fast and efficient as possible - there might be 
+*lots* of instances.
index d2fe830..ce767c6 100644 (file)
 Welcome to UCC::ProgComp 2010!
 
-This document will acquaint you with the competition: the rules, how to write an agent, and what you need to do to enter.
+This document will acquaint you with the competition: the rules, how to 
+write an agent, and what you need to do to enter.
 
-=== What is UCC::ProgComp? ===
-Good question! The facetious answer is that it's the package whose documentation you are currently reading. The long answer is that it's a project of the University Computer Club (UCC), a student club affiliated with the Guild of Undergraduates at the University of Western Australia. UCC::ProgComp is designed to raise interest in programming and raise awareness of what UCC offers.
+=== What is UCC::ProgComp? === Good question! The facetious answer is 
+that it's the package whose documentation you are currently reading. The 
+long answer is that it's a project of the University Computer Club 
+(UCC), a student club affiliated with the Guild of Undergraduates at the 
+University of Western Australia. UCC::ProgComp is designed to raise 
+interest in programming and raise awareness of what UCC offers.
 
-=== Why should I enter? ===
-For a number of reasons:
+=== Why should I enter? === For a number of reasons:
  - there are prizes.
- - it's a low-risk opportunity to learn how to program or to practise your programming. You don't need to be an expert to enter, and it's a great way to do things that you might not otherwise get the opportunity to do.
+ - it's a low-risk opportunity to learn how to program or to practise 
+your programming. You don't need to be an expert to enter, and it's a 
+great way to do things that you might not otherwise get the opportunity 
+to do.
  - To meet other computer-oriented people around UCC.
 
 === What's the basic premise? ===
-Entry in UCC::ProgComp is by writing an agent that plays a modified version of Rock-Paper-Scissors on the morally bankrupt underworld of RPS Island.
+Entry to the UCC::ProgComp 2010 is by writing an "agent".
 
-On RPS Island, this classic game is considerably more complex: the attacking agent must bluff to the defending agent before making its real attack. Agents receive a moderate rewarded for being nice to each other and going for a mutually beneficial tie, but receive the most points for stabbing the other in the back.
+Your agent spends its life in a dystopian RPS underworld, where at any 
+moment another agent could pick a fight with it, after which your agent 
+is obliged to pick a fight with yet another.
 
-An agent consists of a Python, C/C++, Java or MATLAB file with 3 functions:
+On RPS Island, battles are based on Rock-Paper-Scissors, but 
+considerably more involved: the attacking agent must bluff to the 
+defending agent before making its real attack.
+
+If an agent gets picked on for a fight and told rock, paper or scissors, 
+it can either get modest but mutually beneficial points by trying to 
+cause a tie, but risk being slaughtered by the other if it's lying (with 
+a small amount of points awarded if it wins "by accident"), or it can 
+try to win based on that information and get big points for exploiting 
+the other agent with a relatively small punishment for being "tricked" 
+and losing (and no point change in case of an "accidental" tie).
+
+Thus, in any single round there are bigger rewards and smaller 
+consequences in "attacking" the rock, paper or scissors that the enemy 
+agent claims it will use, but cooperation leads to mutual benefit and 
+good agents should turn against agents that try to exploit them. (The 
+full points table can be found in POINTS.txt)
+
+Agents start off with 50 points. If the agent loses all its points, it 
+dies. If it reaches 100 points, it forms a new agent and both return to 
+50 points. (However, the arena in which the agents battle is only so big 
+- if it's too crowded the agent will keep its points and not spawn a 
+child.)
+
+The agent can remember who it has battled in the past and what the other 
+agent has done, but it has no way of communicating this to any other 
+agent, and any "children" of the agent don't inherit this memory.
+
+To provide for both smart learning agents and agents that aren't so 
+complex, both 'long' (1000 round) and 'short' (100 round) variations 
+will be run. You are not allowed to submit different versions of your 
+agent for the different durations - you will have to make a tactical 
+decision about which to target.
+
+
+=== How do I win? ===
+The object of the game is for the descendants of your agent to be the 
+dominant species.
+
+Victory occurs when:
+ * You are the only species left.
+ * You are the most populous species at the 'end of time'.
+ * You are the most populous species when the judges determine that the 
+environment is stable.
+ * The judges say so.
+
+The agent that wins the most will be declared the overall victor.
+
+=== But won't I get thrashed by UCC's leet coders? ===
+
+There are a number of 'arenas' where your agent can battle, so that you 
+-hopefully - get the opportunity to compete with people of roughly your 
+own level of experience.
+
+There will be at least the following arenas:
+ - an arena for the units CITS1200, CITS1210, and GENG2140.
+ - an arena for first-years
+ - an arena for UCC members
+ - an open arena.
+ - any other arenas I think of before the submission deadline comes 
+around.
+
+You may enter your agent in as many arenas as you are eligible to enter. 
+However, you must enter the same agent for each arena.
+
+=== OK: how do I code that? ===
+
+An agent consists of a Python, C, C++, Java or MATLAB file with 3 
+functions:
 
  * A function to attack another bot.
  * A function to defend itself against another bot.
- * An optional function to receive the results of its battle, so that it can learn how other agents play.
+ * An optional function to receive the results of its battle, so that it 
+can learn how other agents play.
 
-=== OK, how? ===
-Keep reading! Read HOWTO.txt, then go to README.txt to see what other documents are available.
+Read HOWTO.txt for more info, then go to README.txt to see what other 
+documents are available.
 
 === I've read everything and I'm still confused! ===
-Firstly, check the FAQs at http://progcomp.ucc.asn.au
-If you're still stumped, contact us via the link at http://progcomp.ucc.asn.au
\ No newline at end of file
+
+Firstly, check the FAQs at <http://progcomp.ucc.asn.au>. If you're still 
+stumped, contact us via the link at <http://progcomp.ucc.asn.au>.
index 512da50..a4dfcf0 100644 (file)
@@ -1,7 +1,8 @@
  - number of agents can spiral out of control very quickly, e.g. if Wash and Angel start duking it out.
-   * Need to make supervisor smart enough to kill montonically increasing sequences.
+   * Need to make supervisor smart enough to kill monotonically increasing sequences.
+   * Currently it can cap the number of bots; not sure if it does it in a fair way. It's presently entirely opportunistic; if you happen to be having a kid when the arena's full, you just silently fail and keep your points. This could result in an agent being able to spawn with 101 points if a gap comes up at the right time, while a 201 point agent isn't able to because he/she doesn't get in on time. Is this fair?
+
+ - Python code seems to trust you not to monkey around with your stats...?
 
- - agents die after MAX_AGE fights, not MAX_AGE rounds
- - code seems to trust you not to monkey around with your stats...?
  - coding styles are inconsistent throughout
  - layout still needs some work
diff --git a/proposal.txt b/proposal.txt
deleted file mode 100644 (file)
index 376eba9..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-Wouldn't it be nice to do the programming competition again this year? I have 
-an idea that's simple enough for the non-programmer to have a good chance at 
-winning yet allows deep complexity for anyone keen to get their hands dirty.
-
-The Game
---------
-My idea is inspired by the classic iterated Prisoner's Dilemma problem in game 
-theory. The premise is to write an "agent" to survive and thrive in the morally 
-bankrupt RockPaperScissors (RPS) land.
-
-Your agent spends its life in a dystopian RPS underworld, where at any moment 
-another agent could pick a fight with it, after which your agent is obliged to 
-pick a fight with yet another. In RPS battle, the instigating agent gets a 
-chance (which he must use) to tell the truth or lie about which tool he is 
-going to use (rock, paper, or scissors). Agents start off with 10 points, and 
-gain and lose points when they win, lose and tie a round depending on the 
-circumstances of the fight. The points table is in the technicalities 
-document:
-
-http://shmookey.ucc.asn.au/technicalities
-
-Synopsis: if an agent gets picked on for a fight and told rock, paper or 
-scissors, it can either get modest but mutually beneficial points by trying to 
-cause a tie, but risk being slaughtered by the other if it's lying (with a 
-small amount of points awarded if it wins "by accident"), or it can try to win 
-based on that information and get big points for exploiting the other agent 
-with a relatively small punishment for being "tricked" and losing (and no point 
-change in case of an "accidental" tie).
-
-Thus, in any single round there are bigger rewards and smaller consequences in 
-"attacking" the rock, paper or scissors that the enemy agent claims it will 
-use, but cooperation leads to mutual benefit and good agents should turn 
-against agents that try to exploit them.
-
-If the agent loses all its points, it dies. If it reaches 20 points, it forms a 
-new agent and both return to 10 points. The agent can remember who it has 
-battled in the past and what the other agent has done, but it has no way of 
-communicating this to any other agent, and any "children" of the agent don't 
-inherit this memory.
-
-Winning Conditions
-------------------
-The object of the game is for the descendants of your agent to be the dominant 
-species in an evolutionarily stable environment. The environment is declared 
-evolutionarily stable when the proportions of species populations remains the 
-same (with a tolerance of 5%) over ten thousand iterations, or if there is only 
-once species remaining, or if the judges say so.
-
-There will be a prize for the winner consisting of whatever we can scrounge up 
-plus a special certificate you can keep forever and frame and love. Entrants 
-whose species survive to evolutionary stability will also receive a 
-certificate.
-
-Entry Cost
-----------
-The cost of entry per person is $3 for UCC members and $5 for everyone else. 
-Your entry may contain one (1) agent and you may only enter once. UCC reserves 
-the right to withdraw any agent without refund if it causes technical or 
-administrative difficulty, after a reasonable attempt at resolution is made.
-
-Non-Programmers and Beginners
------------------------------
-There will be simple sample agents available that demonstrate how easy it 
-is to turn your idea into code. If you're able to visualise your idea as a 
-series of instructions you might tell a small child, you'll be able to 
-make it into an agent.
-
-If you don't understand the next section, don't worry, modifying the samples to 
-do your bidding will work just as well as writing your agent from scratch.
-
-Technical Details
------------------
-The challenge will be operated by a supervisor module that picks the fights in 
-a "fair" way such that each agent gets to fight every other agent (supposing no 
-agents die) and each agent gets to see battle as frequently as possible. The 
-supervisor will be able to do any number of iterations in one go, after which 
-statistics can be gathered before doing the next set of iterations.
-
-The easiest way to create an agent is with Python. Python is a popular 
-scripting language with a simple, easy to pick up syntax that resembles 
-pseudocode, and is well-adapted to this kind of task. Another advantage to 
-using Python is that the supervisor can talk to the agent directly, and the 
-programmer will not have to worry about maintaining state or validating input 
-and output. A Python agent should be a class that implements at least the 
-specification laid out in the technicalities document:
-
-http://shmookey.ucc.asn.au/technicalities
-
-The supervisor will store the number of points the agent has and the 
-number of children for your convenience. Your module may use any resource 
-available in the standard Python distribution. You are expected to use 
-member variables of your class to keep state.
-
-You can use any language you like for your agent, really. Interfacing to 
-non-python agents is via stdin/stdout, so your language's builtin print and 
-read functions will work, but beware: if an agent makes a single mistake in its 
-input or output, the supervisor will declare it insane - which in 
-RockPaperScissors land carries the death penalty. The format of the input and 
-output is documented in the technicalities document:
-
-http://shmookey.ucc.asn.au/technicalities
-
-The agent is run once per instance and is expected to maintain its own state. 
-Not maintaining state correctly could lead to a very confused agent, left 
-wondering why it's not dead, or why the baby hasn't come. Don't leave your 
-agent wondering.
-
-A sample agent in Python, Java and C will be provided. Your agent does not have 
-to be open-source, but it must be submitted as source-code to prevent cheating. 
-If the agent is not in Python, build instructions must also be submitted.
-
diff --git a/src/README b/src/README
deleted file mode 100644 (file)
index f1cddde..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<<PLEASE SEE THE CONTENTS OF doc/ FIRST>>
-
-Hi there,
-
-Thanks for taking interest in the UCC Programming Competition 2010. If you 
-don't already know what it's all about, check out the information provided in 
-the docs directory, which contains a full and authoritative* description for
-the running of the competition.
-
-This file is by no means complete, and not ready for circulation.
-
-The first thing you'll probably want to do is see it work. Try running:
-
-./simulate -v
-
-to see the sample agents duke it out for up to 150 rounds (the current sample
-agents suck - rounds either go for seconds or for ages). After that, take a
-look at sampleAgents.py to see how agents are implemented on top of the
-BaseAgent and LearningAgent classes. When you're ready to try out your own,
-edit the first few lines of simulate.py to include your agent.
-
-...and if all you're interested in is participating, that's it! You can stop
-reading, and start work on the agent that will outsmart them all!
-
-
-* Or rather, it wil by the time this package is ready for distribution.
diff --git a/src/README.txt b/src/README.txt
new file mode 100644 (file)
index 0000000..2dae87d
--- /dev/null
@@ -0,0 +1,24 @@
+Hi there,
+
+You've reached the source directory of the UCC::ProgComp 2010.
+
+For documentation, see the contents of the "doc" directory.
+
+The first thing you'll probably want to do is see it work. Try running:
+
+./simulate -v
+
+to see the sample agents duke it out.
+
+This is a brief overview of the included files and directories:
+ - SampleAgents.py : the sample agents. This is the bit you care about!
+ - arenas/ : arenas define which agents play against which, and some other parameters.
+ - link/ : Other languages belong here.
+ - conf.py : has various useful things like the ability to turn on debug support.
+
+The rest of the files are probably not useful to you, but just for completeness:
+ - simulate.py : run a simulation.
+ - uccProgComp.py : the guts of the competition.
+ - rpsconst.py : various constants, such as the points table.
+
+Ignore anything else. :P
\ No newline at end of file
diff --git a/src/link/Mathematica/pyml.tar.gz b/src/link/Mathematica/pyml.tar.gz
deleted file mode 100644 (file)
index 498748f..0000000
Binary files a/src/link/Mathematica/pyml.tar.gz and /dev/null differ
diff --git a/src/link/Mathematica/pythonika-1.0.tar.gz b/src/link/Mathematica/pythonika-1.0.tar.gz
deleted file mode 100644 (file)
index 6611f5d..0000000
Binary files a/src/link/Mathematica/pythonika-1.0.tar.gz and /dev/null differ
diff --git a/src/selectAlgorithms.py b/src/selectAlgorithms.py
deleted file mode 100644 (file)
index 41be346..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Alternative (obsolete) algorithms for selecting agents for battle.
-# They're all a bit crap and only here for comparison purposes.
-
-
-# Selects an opponent and removes it from the list of remaining potential opponents.
-       # This is just an example, but the fact that the first agent will miss out on having
-       # a fight picked with it it, and that the last agent won't get to pick a fight, seems
-       # to not matter very much. Can probably be left as-is.
-       def ChoosePair (self):
-               # This approach forces each agent to defend once and attack once per round.
-               # Keep track of the remaining population.
-               remaining = self.population[:]
-               agentID = random.randint (0,len(remaining)-1)
-               defender = remaining.pop (agentID) # Not really a defender (try to work it out)!
-               while len (remaining) > 1:
-                       if defender.GetPoints () < 1:   # If the agent died before it got a chance to attack
-                               attackerID = random.randint (0,len(remaining)-1)
-                               attacker = remaining.pop (attackerID)
-                       else: attacker = defender
-                       defenderID = random.randint (0,len(remaining)-1)
-                       defender = remaining.pop (defenderID)
-                       yield attacker, defender
-

UCC git Repository :: git.ucc.asn.au