place files into /dev/shm by default, prettify xml, more useful run.sh output

This commit is contained in:
josch 2012-05-20 12:39:11 +02:00
parent 4eb6307be0
commit cb988c68d9

22
run.sh
View file

@ -1,4 +1,4 @@
#!/bin/sh -ex #!/bin/sh -e
if [ $# -ne 3 ]; then if [ $# -ne 3 ]; then
echo usage: $0 order.xml packlist.xml scoring.xml echo usage: $0 order.xml packlist.xml scoring.xml
@ -7,12 +7,30 @@ fi
rm -f score_max 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 python bruteforce2.py $1 | sort -r | xargs --max-procs=4 --max-args=1 python bruteforce3.py $1 $2 $3
# format the result nicely
if type xmllint > /dev/null 2>&1; then
mv $2 $2.tmp mv $2 $2.tmp
xmllint --output $2 --format $2.tmp xmllint --output $2 --format $2.tmp
rm -f $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 palletViewer -o $1 -p $2 -s $3
echo
echo to check the final score, run:
echo
echo python evaluate.py $1 $2 $3 echo python evaluate.py $1 $2 $3