From cb988c68d9eabe9f36836eedd4742f7b8f60482f Mon Sep 17 00:00:00 2001 From: josch Date: Sun, 20 May 2012 12:39:11 +0200 Subject: [PATCH] place files into /dev/shm by default, prettify xml, more useful run.sh output --- run.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/run.sh b/run.sh index 4b84ce6..2ea6139 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh -ex +#!/bin/sh -e if [ $# -ne 3 ]; then echo usage: $0 order.xml packlist.xml scoring.xml @@ -7,12 +7,30 @@ fi rm -f score_max +# place temporary files in tmpfs instead of disk +if [ -d /dev/shm ]; then + export TMPDIR=/dev/shm +fi + +# generate the results python bruteforce2.py $1 | sort -r | xargs --max-procs=4 --max-args=1 python bruteforce3.py $1 $2 $3 -mv $2 $2.tmp -xmllint --output $2 --format $2.tmp -rm -f $2.tmp +# format the result nicely +if type xmllint > /dev/null 2>&1; then + mv $2 $2.tmp + xmllint --output $2 --format $2.tmp + rm -f $2.tmp +fi +echo +echo maximum score is: `cat score_max` +echo +echo final packlist is ready in: $2 +echo +echo to view it in palletViewer, run: +echo echo palletViewer -o $1 -p $2 -s $3 - +echo +echo to check the final score, run: +echo echo python evaluate.py $1 $2 $3