#!/usr/bin/env bash
set -euo pipefail

echo "Warning, high epilson values will take up to 30GB to run!"
echo "It is a good idea to disable these values."

for a in 0.1 0.5 0.7 0.9; do
  for g in 1.0 0.9 0.5 0.1; do
    for e in 0.1 0.25 0.5 0.75 0.9; do
      for agent in qlearning approximateqlearning; do
        echo "alpha $a gamma $g epsilon $e agent $agent"
	file="a$a-g$g-e$e-$agent"
	if [ -f $file ]; then
	  echo "skipping $file, exists"
	else
	  if [ "$agent" = approximateqlearning ]; then
    	    ./tetris train $agent -a $a -g $g -e $e -n 20000 >> "$file"
	  else
    	    ./tetris train $agent -a $a -g $g -e $e -n 200000 >> "$file"
	  fi
	fi
      done
    done
  done
done
