From c4f926438dcb8abe805e910399940f79ff643c4b Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Thu, 14 Sep 2017 15:39:41 -0500 Subject: Add files via upload --- sourcecodes/k-best/src/data2netk_poster.sh | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sourcecodes/k-best/src/data2netk_poster.sh (limited to 'sourcecodes/k-best/src/data2netk_poster.sh') diff --git a/sourcecodes/k-best/src/data2netk_poster.sh b/sourcecodes/k-best/src/data2netk_poster.sh new file mode 100644 index 00000000..6b3a34ca --- /dev/null +++ b/sourcecodes/k-best/src/data2netk_poster.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +binpath=`dirname $0` + +if [ $# -ne 4 ]; then + echo Usage: data2net.sh datafile resultdir k 1>&2 + exit 1 +fi + +datafile=$1; shift +#score=$1; shift +rdir=$1; shift +k=$1;shift +n=$1;shift + +nof_vars=`head -1 $datafile|wc -w` +echo "The number of variables is $nof_vars." + +#HR: +if [ "$n" -eq 0 ] +then + maxindegree=`expr $nof_vars - 1` +else + maxindegree=$n +fi + +#maxindegree=`expr $nof_vars - 1` +echo "maxindegree is $maxindegree." + +#HR: +nof_instances=`cat $datafile | wc -l` +#delete the header and type +nof_instances=`expr $nof_instances - 2` +echo "The number of instances is $nof_instances." + + +START=$(date +%s%N) +$binpath/get_kbest_parents $nof_vars ${rdir} $k +#HR +END=$(date +%s%N) +#DIFF=$(( $END - $START )) +DIFF2=$(( $END - $START )) +echo "get_kbest_parents is done." +echo "get_kbest_parents took $DIFF2 n-seconds." + +START=$(date +%s%N) +$binpath/get_kbest_nets $nof_vars ${rdir} $k +#HR +END=$(date +%s%N) +#DIFF=$(( $END - $START )) +DIFF3=$(( $END - $START )) +echo "get_kbest_nets is done." +echo "get_kbest_nets took $DIFF3 n-seconds." + +DIFF=`expr $DIFF1 + $DIFF2 + $DIFF3` +echo "The total process took $DIFF n-seconds." -- cgit 1.4.1