aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rwxr-xr-xpython/start.sh10
-rwxr-xr-xstart.sh39
3 files changed, 41 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index b6e4761..2e43717 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,3 +127,5 @@ dmypy.json
# Pyre type checker
.pyre/
+
+*.log \ No newline at end of file
diff --git a/python/start.sh b/python/start.sh
deleted file mode 100755
index 455944d..0000000
--- a/python/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#/bin/bash
-(cd dotsandboxes; python3 dotsandboxesserver.py 8080) &
-python3 agent.py 10001 &
-python3 agent.py 10002 &
-
-echo "Press enter to close all programs"
-read TRASH;
-
-trap "exit" INT TERM
-trap "kill 0" EXIT
diff --git a/start.sh b/start.sh
new file mode 100755
index 0000000..edf5b9f
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,39 @@
+#/bin/bash
+#Bash script for automating evaluate
+(python3 python/dotsandboxes/dotsandboxesserver.py 8080) > server.log &
+echo "Web server running on http://127.0.0.1:8080"
+
+PORT=10000
+for a in 1 2
+do
+ ((PORT=PORT+1));
+ echo "Available Agents:"
+ echo "1: Random"
+ echo "2: Monte Carlo Tree Search"
+ echo "3: Alpha-Beta Pruning/Minimax"
+ PORT=`expr $PORT + 1`;
+ read -p "Agent:" Agent
+ case $Agent in
+ 1) echo "Random Agent running on ws://127.0.0.1:$PORT"
+ (python3 python/dotsandboxes/dotsandboxesagent.py $PORT) > $a.log &
+ ;;
+ 2) echo "MCTS Agent running on ws://127.0.0.1:$PORT"
+ (python3 python/agent_MCTS.py $PORT) > $a.log &
+ ;;
+ 3) echo "AB Agent running on ws://127.0.0.1:$PORT"
+ (python3 python/agent_MCTS.py $PORT) > $a.log &
+ ;;
+ *) echo "Invalid input. Human player assumed. Undefined behavior will likely occur because I am lazy."
+ ;;
+ esac
+done
+
+
+
+
+
+echo "Press enter to close all programs"
+read TRASH;
+
+trap "exit" INT TERM
+trap "kill 0" EXIT