#!/bin/sh

# This script runs two million training games of the specified matchup.
#
# Run it like: ./do_matchup Hoax Vulca
#
# The order of the arguments is important!  Assume that the peoples are
# in this order: Hoax, Vulca, Mimix, Flit, Khind, Terrah, Pillar, Aqua
#
# The first argument must come earlier in this list than the second
# argument.  For example, "Terrah Vulca" is incorrect!  It should be
# "Vulca Terrah" instead.
#
# This programs called by this script create and modify the neural networks
# in the "./networks" directory.  You'll need to re-do "make install" to
# copy them to the proper location after training is complete.
#
# You should probably delete any old networks before starting this, or
# you will just continue any previous training!

# Create and pre-condition both networks (see condition.c for details)
./condition networks/bluemoon.net.$1.$2
sleep 1
./condition networks/bluemoon.net.$2.$1

# Run 20,000 iterations of the training program (100 games each)
for i in `seq 1 20000`
do
	./learner -1 $1 -2 $2 >> bluemoon.$1.$2.out
	echo $i
done

# Run 10,000 games in verbose mode for statistical purposes
./learner -1 $1 -2 $2 -v -n 10000 > bluemoon.$1.$2.verbose
