2012-05-20 10:39:11 +00:00
|
|
|
#!/bin/sh -e
|
2012-05-08 08:01:10 +00:00
|
|
|
|
2012-05-15 01:24:24 +00:00
|
|
|
if [ $# -ne 3 ]; then
|
|
|
|
echo usage: $0 order.xml packlist.xml scoring.xml
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-05-08 08:01:10 +00:00
|
|
|
rm -f score_max
|
|
|
|
|
2012-05-20 10:39:11 +00:00
|
|
|
# place temporary files in tmpfs instead of disk
|
|
|
|
if [ -d /dev/shm ]; then
|
|
|
|
export TMPDIR=/dev/shm
|
|
|
|
fi
|
|
|
|
|
|
|
|
# generate the results
|
2012-05-15 13:39:47 +00:00
|
|
|
python bruteforce2.py $1 | sort -r | xargs --max-procs=4 --max-args=1 python bruteforce3.py $1 $2 $3
|
2012-05-15 01:24:24 +00:00
|
|
|
|
2012-05-20 10:39:11 +00:00
|
|
|
# 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
|
2012-05-15 22:57:13 +00:00
|
|
|
|
2012-05-20 10:39:11 +00:00
|
|
|
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
|
2012-05-15 01:24:24 +00:00
|
|
|
echo palletViewer -o $1 -p $2 -s $3
|
2012-05-20 10:39:11 +00:00
|
|
|
echo
|
|
|
|
echo to check the final score, run:
|
|
|
|
echo
|
2012-05-15 01:24:24 +00:00
|
|
|
echo python evaluate.py $1 $2 $3
|