#!/bin/bash

inputF=$1
outputD=$2




deci=0.2
for j in `seq 1 4`;
do

alpha=$(echo $j*$deci | bc )

ioutputD=$outputD"_"$j

if [ -e $ioutputD ]; then 
  rm -r $ioutputD
fi

mkdir $ioutputD

for i in `seq 1 15`;
do
  outF_tmp=` echo $inputF | cut -d '.' -f1`
  outF=$outF_tmp$i".gw"
  echo $outF
  
 # echo $alpha
  echo $ioutputD
  python random_rewire_gw.py $inputF $alpha $ioutputD/$outF 
done

if [ -e $ioutputD"-edge" ]; then
  rm -r $ioutputD"-edge"
fi
mkdir $ioutputD"-edge"


for item in `ls $ioutputD`
do
    new_item_tmp=`echo $item | cut -d'.' -f 1`
    new_item=$new_item_tmp"-edge.txt"
    echo $new_item
   ./leda2list $ioutputD/$item > $ioutputD"-edge"/$new_item
done

done
