#!/bin/sh
#
# usage: general_test.sh <type> <variables_start> <variables_end> <trials>
#
# types:
#
# 3sat_const_ratio (c/v=4) 
# 3sat_varying_ratio (v=40, variables is the number of clauses!) 
# color 
# hc
# queens1 (queens-x1 and queens-x2)
# queens2 (queens-x1 and queens-y)
# knapsack (KS(127, C) and KS(127, C-1))
#
# Calls the script general_times.sh
#
# (C) Emilia Oikarinen, 2005

type=$1
v1=$2
v2=$3
trials=$4

while test $v1 -le $v2
  do

  case "$type" in

      '3sat_const_ratio' | '3sat_varying_ratio' | 'hc' | 'color' | 'queens1' |\
      'queens2' | 'knapsack')

          echo -n $v1" "

          ./general_times.sh $type $v1 $trials
          ;;

      *)
          echo "Type not supported. Supported types: 3sat_const_ratio, 3sat_varying_ratio," 
          echo "color, hc, queens1, queens2 and knapsack." 
          exit 1
          ;;
  esac
  
  case "$type" in
      
      '3sat_varying_ratio')
          v1=`expr $v1 + 5`
          ;;
      
      '3sat_const_ratio')
          v1=`expr $v1 + 5`
          ;;

      'knapsack')
          v1=`expr $v1 + 4`
          ;;

      *)
          v1=`expr $v1 + 1`
          ;;
  esac
done

echo "... done."