-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprp
99 lines (81 loc) · 2.47 KB
/
prp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#! /bin/bash
set -e
BASEDIR="$(dirname "$0")"
PRPDIR="/home/cjmuise/Projects/prp/src"
function die {
echo "$@" 1>&2
exit 1
}
function usage {
die "usage: $(basename "$0") [DOMAIN_FILE] PROBLEM_FILE SEARCH_OPTION ..."
}
# Paths to planner components
TRANSLATE="$PRPDIR/translate/translate.py"
PREPROCESS="$PRPDIR/preprocess/preprocess"
SEARCH="$PRPDIR/search/downward"
# Settings
INV_TIME_LIMIT="3"
# Check for citation request
if [ "--citation" = "$1" ]; then
echo "
@inproceedings{muise12icapsfond,
author = {Christian Muise and Sheila A McIlraith and J Christopher Beck},
title = {Improved Non-deterministic Planning by Exploiting State Relevance},
booktitle = {The 22nd International Conference on Automated Planning and Scheduling (ICAPS)},
year = {2012},
subdiscipline = {Artificial Intelligence},
type = {Conference Proceedings}
}
@inproceedings{muise-aaai-14,
title={Computing Contingent Plans via Fully Observable Non-Deterministic Planning},
author={Muise, Christian and Belle, Vaishak and McIlraith, Sheila A.},
booktitle={The 28th AAAI Conference on Artificial Intelligence},
year={2014},
url={http://www.haz.ca/papers/muise-aaai-14.pdf}
}
@inproceedings{muise-icaps-14,
title={Non-Deterministic Planning With Conditional Effects},
author={Muise, Christian and McIlraith, Sheila A. and Belle, Vaishak},
booktitle={The 24th International Conference on Automated Planning and Scheduling},
year={2014},
url={http://www.haz.ca/papers/muise-icaps-14.pdf}
}
"
exit 1
fi
# Need to explicitly ask for GNU time (from MacPorts) on Mac OS X.
if [[ "$(uname)" == "Darwin" ]]; then
TIME="gtime"
if ! which $TIME >/dev/null; then
die "$TIME must be installed on Mac OSX (from MacPorts, perhaps) for this to work"
fi
else
TIME="command time"
fi
TIME="$TIME --output=elapsed.time --format=%S\n%U\n"
if [[ "$#" -lt 2 ]]; then
usage
fi
IPC="ipc"
if [[ "$1" == "debug" ]]; then
IPC="debug $IPC"
shift
fi
echo "1. Running translator"
if [[ -e "$2" ]]; then
echo "Second argument is a file name: use two translator arguments."
$TIME "$TRANSLATE" "$INV_TIME_LIMIT" "$1" "$2"
shift 2
else
echo "Second argument is not a file name: auto-detect domain file."
$TIME "$TRANSLATE" "$INV_TIME_LIMIT" "$1"
shift
fi
echo
echo "2. Running preprocessor"
$TIME --append "$PREPROCESS" < output.sas
echo
echo "3. Running search"
echo "$SEARCH" "$IPC" policy-repair < output "$@"
"$SEARCH" $IPC policy-repair < output "$@"
echo