#!/bin/sh
#
# This is a shell script to generate CSPs in batch.The meaning of variables
# as follow,
#    N- the number of variables
#    K- domain size
#    C- number of constrains
#    I- the degree of interchangeability
#    T- tightness
#    NUM - the number of instances of each CSP
#    R- the series numner of the outout file
# The result will be stored into a series of files, and all "fail generation"
# will be recorded into a file named "fail_record"
#
echo "In proceeding, please wait!"
N=10
K=5
R=0
NUM=20
# check if the file-"fail_record" has been existing, if yes, then delete it
if test -f fail_record
then rm fail_record
fi
for C in 5 9 13 18 22 27 31 36 40 45
 do
  for I in 1 2 3 4 5
   do
    for T in  0.04 0.12 0.20 0.28 0.36 0.44 0.52 0.60 0.68 0.76 0.84 0.92 
     do
      i=1
      while [ $i -le NUM ]
      do
        i=`expr $i + 1`
        R=`expr $R + 1` 
        gen_batch $N $K $C $I $T $R irand-$C-$I-$T.$R
      done
     R=0
     done
   done
 done
echo "See you again!"

