place files into /dev/shm by default, prettify xml, more useful run.sh output
This commit is contained in:
parent
4eb6307be0
commit
cb988c68d9
1 changed files with 23 additions and 5 deletions
28
run.sh
28
run.sh
|
@ -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
|
||||||
|
|
||||||
mv $2 $2.tmp
|
# format the result nicely
|
||||||
xmllint --output $2 --format $2.tmp
|
if type xmllint > /dev/null 2>&1; then
|
||||||
rm -f $2.tmp
|
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 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
|
||||||
|
|
Loading…
Reference in a new issue