-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlpg-clean
executable file
·42 lines (31 loc) · 946 Bytes
/
lpg-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/lpg
# lpg-td-1.0
################################################################
#### main
plan(){
echo $(whoami)@$(hostname)
$bin $OPTIONS -f problem.pddl -o domain.pddl -speed -out problem
}
finalize (){
awk '/^[0-9]+:.*/{ y=match($0,/\(.*\)/); print substr($0,RSTART,RLENGTH)}' problem.SOL > plan
[[ $(cat plan | wc -l) -gt 0 ]] && cp plan $probdir/$probname.plan
}
negatively-proven (){
grep "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