-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-clean
executable file
·42 lines (32 loc) · 1.06 KB
/
template-clean
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
#!/bin/bash
#-*- mode:sh -*-
SCRDIR=$(dirname $(readlink -ef $0))
################################################################
#### default options
bin=$SCRDIR/ff-larger
################################################################
#### main
# Run the planner; exit status will be the status of the entire script
plan(){
echo $(whoami)@$(hostname)
$bin -i 3 $OPTIONS \
-f problem.pddl -o domain.pddl
}
# Copy the plan files
finalize (){
grep "^\(step\)\?\s*[0-9]\+: \(.*\)" $log | cut -d: -f 2 | sed -e "s/^ \(.*\)/(\1)/g" > plan
[[ $(cat plan | wc -l) -gt 0 ]] && cp plan $probdir/$probname.plan
}
# When plan was not found, check if the entire problem space is searched
negatively-proven (){
grep "problem proven unsolvable" $log || \
grep "No plan will solve it" $log
}
# Print the costs of plans found, if any
report-results (){
local cost=$(cat plan | wc -l)
[[ -e plan && $cost -gt 0 ]] && echo "Plan cost: " $cost
}
################################################################
# required
. $SCRDIR/common.sh