about summary refs log tree commit diff
path: root/sourcecodes/k-best/src/data2net.sh
blob: 3bc5d133741cd77f0010d5cbe908434fe0f2adba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

binpath=`dirname $0`

if [ $# -ne 4 ]; then
    echo Usage: data2net.sh vdfile datafile score resultdir 1>&2
    exit 1
fi

vdfile=$1;    shift 
datafile=$1;  shift
score=$1;     shift
rdir=$1;      shift

mkdir -p $rdir
nof_vars=`cat $vdfile | wc -l`

START=$(date +%s)
$binpath/get_local_scores $vdfile $datafile $score 1 0 ${rdir}/res
$binpath/split_local_scores   $nof_vars ${rdir}
$binpath/reverse_local_scores $nof_vars ${rdir}
END=$(date +%s)
DIFF=$(( $END - $START ))
echo "Local score took $DIFF seconds"

START=$(date +%s)
$binpath/get_best_parents     $nof_vars ${rdir}
$binpath/get_best_sinks       $nof_vars ${rdir} ${rdir}/sinks
$binpath/get_best_order       $nof_vars ${rdir}/sinks ${rdir}/ord
$binpath/get_best_net         $nof_vars ${rdir} ${rdir}/ord ${rdir}/net
$binpath/score_net            ${rdir}/net ${rdir}
END=$(date +%s)
DIFF=$(( $END - $START ))
echo "Best network took $DIFF seconds"