#!/bin/bash -p

# Run all experiments on pool 302 with 100k points
# Assumes we are in the drectory ANN/bin, and all scripts are there, too !


typeset -i h=7
# Hosts -> distribution:
# 7 - 10  -> uniform
# 11 - 14 -> clustered
# 15 - 18 -> correlated
# Hosts -> dim range:
#  7 / 11 / 15  ->   3..18
#  8 / 12 / 16  ->  19..27
#  9 / 13 / 17  ->  28..35
# 10 / 14 / 18  ->  36..40


while [[ $h -lt 19 ]]
do
	# h -> distribution
	if [[ $h -lt 11 ]]
	then
		distrib="uniform"
	elif [[ $h -lt 15 ]]
	then
		distrib="clustered"
	else
		distrib="correlated"
	fi

	# h -> first/last
	if [[ $h == 7 || $h == 11 || $h == 15 ]]
	then
		first=3
		last=18
	elif [[ $h == 8 || $h == 12 || $h == 16 ]]
	then
		first=19
		last=27
	elif [[ $h == 9 || $h == 13 || $h == 17 ]]
	then
		first=28
		last=35
	else
		first=36
		last=40
	fi
	# h -> hostname
    if [[ $h -lt 10 ]]
    then
        n="0$h"
    else
        n=$h
    fi

    echo "ifipool302-$n"
    ssh ifipool302-$n.in.tu-clausthal.de ANN/bin/run_test $first $last 0.1 100000 $distrib

	(( h += 1 ))
done


