forked from rock-planning/planning-lama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plan.in
44 lines (37 loc) · 1.03 KB
/
plan.in
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
#! /bin/sh
# Paths to planner components
ROOT="@CMAKE_INSTALL_PREFIX@"
TRANSLATE="$ROOT/lib/lama/translate/translate.py"
PREPROCESS="$ROOT/bin/lama-planner-preprocess"
SEARCH="$ROOT/bin/lama-planner-search"
run_planner() {
echo "1. Running translator: $TRANSLATE"
python3 "$TRANSLATE" "$1" "$2"
echo "2. Running preprocessor: $PREPROCESS"
"$PREPROCESS" < output.sas
echo "3. Running search: $SEARCH"
"$SEARCH" "fFlLi" "$3" < output
}
check_input_files() {
if [ ! -e "$1" ]; then
echo "Domain file \"$1\" does not exist."
exit 1
fi
if [ ! -e "$2" ]; then
echo "Problem file \"$2\" does not exist."
exit 1
fi
}
# Make sure we have exactly 3 command line arguments
if [ $# -ne 3 ]; then
echo "Usage: \"plan <domain_file> <problem_file> <result_file>\""
exit 1
fi
check_input_files "$1" "$2"
# Command line arguments seem to be fine, run planner
run_planner "$1" "$2" "$3"
# Add cleanup: move temporary files to `tmp` folder
rm -f all.groups
rm -f test.groups
rm -f output
rm -f output.*