-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm-clean
executable file
·40 lines (30 loc) · 917 Bytes
/
m-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
#!/bin/bash
#-*- mode:sh -*-
SCRDIR=$(dirname $(readlink -ef $0))
################################################################
#### default options
bin=$SCRDIR/M
################################################################
#### main
plan(){
echo $(whoami)@$(hostname)
$bin domain.pddl problem.pddl -Q $OPTIONS
}
finalize (){
awk '/^[0-9]+ +:.*/{ y=match($0,/\(.*\)/); print substr($0,RSTART,RLENGTH)}' $log > 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