Bug in simulate.py caused by "INTERNAL_ERROR"
authorSam Moore <[email protected]>
Sat, 24 Dec 2011 05:52:12 +0000 (13:52 +0800)
committerSam Moore <[email protected]>
Sat, 24 Dec 2011 05:52:12 +0000 (13:52 +0800)
When INTERNAL_ERRORs occur, the colour wasn't added to the array in the "ALL" results.
So when the script looks up agents["ALL"][index][4] (the colour entry), there was an indexing error.
Fixed by adding the colour to the result array when INTERNAL_ERROR occurs.

TODO: Discover cause of INTERNAL_ERROR - in the manager program

It occurs on mufasa, but not on my laptop.
I believe it is due to AI timeouts not being handled correctly by the manager program (stratego).
On my laptop, things run nice and fast, and since all the AI work properly, there are no timeouts.
On mufasa, things run shit and slow, and pretty much every game I tested ended with a move timeout.
Timeout causes broken pipe after AI program is told to exit?

As a temporary measure, increased timeout to 60s (from 2s). If this doesn't stop timeouts,
there must be some other factor making things slow.
"The problem is determining where the shittiness lies... is it the shittiness of the VM, the shittiness of python,
the shittiness of the manager program..."

Running another test round on mufasa over christmas. Hopefully it will finish running by new year. (Assume 60s a move, 300 moves a game... 12 games...)

Considering putting my laptop in the clubroom and just running the competition on that.

agents/basic_cpp/Makefile
judge/manager/ai_controller.h
judge/simulator/Makefile
judge/simulator/simulate.py

index 0a249b3..6c1f9fb 100644 (file)
@@ -2,7 +2,7 @@
 # Sample C++ Stratego AI
 # UCC Programming Competition 2012 
 
-CPP = g++ -Wall -pedantic -lSDL -lGL  -g
+CPP = g++ -Wall -pedantic -g
 OBJ = basic_cpp.o
 
 BIN = basic_cpp
index 7d62591..ee053e6 100644 (file)
@@ -11,7 +11,7 @@
 class AI_Controller : public Controller, private Program
 {
        public:
-               AI_Controller(const Piece::Colour & newColour, const char * executablePath, const double newTimeout = 2.0) : Controller(newColour, executablePath), Program(executablePath), timeout(newTimeout) {}
+               AI_Controller(const Piece::Colour & newColour, const char * executablePath, const double newTimeout = 60.0) : Controller(newColour, executablePath), Program(executablePath), timeout(newTimeout) {}
                virtual ~AI_Controller() {}
 
                
index 6296c3a..c95e891 100644 (file)
@@ -2,11 +2,11 @@
 # Not used for building simulate.py
 # Used for building/removing results
 
-BASEDIR = /home/sam/Documents/progcomp2012/progcomp
-RESULTSDIR = /home/sam/Documents/progcomp2012/progcomp/web/results
-LOGDIR = /home/sam/Documents/progcomp2012/progcomp/web/log
-AGENTSDIR = /home/sam/Documents/progcomp2012/progcomp/agents
-MANAGER = /home/sam/Documents/progcomp2012/progcomp/judge/manager/stratego
+BASEDIR = /../../
+RESULTSDIR = /../../web/results
+LOGDIR = /../../web/log
+AGENTSDIR = /../../agents
+MANAGER = /../../judge/manager/stratego
 
 
 
index aead755..b84a525 100755 (executable)
@@ -234,8 +234,8 @@ for roundNumber in range(totalRounds, totalRounds + nRounds):
                                                sys.stdout.write("Garbage output! \"" + outline + "\"\n")
                                        red["INTERNAL_ERROR"].append((blue["name"], gameID, scores["INTERNAL_ERROR"][0]))
                                        blue["INTERNAL_ERROR"].append((red["name"], gameID, scores["INTERNAL_ERROR"][0]))
-                                       red["ALL"].append((blue["name"], gameID, scores["INTERNAL_ERROR"][0], "INTERNAL_ERROR"))
-                                       blue["ALL"].append((red["name"], gameID, scores["INTERNAL_ERROR"][0], "INTERNAL_ERROR"))
+                                       red["ALL"].append((blue["name"], gameID, scores["INTERNAL_ERROR"][0], "INTERNAL_ERROR", "RED"))
+                                       blue["ALL"].append((red["name"], gameID, scores["INTERNAL_ERROR"][0], "INTERNAL_ERROR", "BLUE"))
                                        managerErrors += 1
                                else:
 

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