-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmff-clean
executable file
·46 lines (36 loc) · 1.06 KB
/
mff-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
43
44
45
46
#!/bin/bash
#-*- mode:sh -*-
SCRDIR=$(dirname $(readlink -ef $0))
################################################################
#### default options
# bin=$SCRDIR/mff-original
bin=$SCRDIR/mff-myself
################################################################
#### main
plan(){
echo $(whoami)@$(hostname)
if grep "metric" problem.pddl
then
$bin $OPTIONS -f problem.pddl -o domain.pddl
else
$bin -s 0 $OPTIONS -f problem.pddl -o domain.pddl
fi
}
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
}
negatively-proven (){
grep "problem proven unsolvable" $log || \
grep "No plan will solve it" $log
}
report-results (){
local cost=$(cat plan | wc -l)
[[ -e plan && $cost -gt 0 ]] && echo "Plan cost: " $cost
}
plan-found (){
local cost=$(cat plan | wc -l)
[[ -e plan && $cost -gt 0 ]]
}
################################################################
. $SCRDIR/common.sh