Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions planutils/packages/metric-ff-2.0/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

wget -q 'https://github.com/siftech/metric-ff/releases/download/metric-ff-sift-2.0.1/metric-ff.gz'
gunzip metric-ff.gz
chmod +x metric-ff
29 changes: 29 additions & 0 deletions planutils/packages/metric-ff-2.0/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Metric Fast-Forward 2.0: extended with numerical state variables and axioms",
"description": "The system is an extension of the FF planner to numerical state variables, more precisely to PDDL2.1 level 2.",
"homepage": "https://fai.cs.uni-saarland.de/hoffmann/metric-ff.html",
"install-size": "1.3M",
"dependencies": [],
"endpoint": {
"services": {
"solve": {
"template": "planner",
"args": [
{
"description": "Search configuration [preset: s=0]; '+H': helpful actions pruning\n 0 Standard-FF: EHC+H then BFS (cost minimization: NO)\n 1 BFS (cost minimization: NO)\n 2 BFS+H (cost minimization: NO)\n 3 Weighted A* (cost minimization: YES)\n 4 A*epsilon (cost minimization: YES)\n 5 EHC+H then A*epsilon (cost minimization: YES)",
"name": "searchflag",
"type": "int",
"default": 5
},
{
"name": "weightval",
"description": "Set weight w for search configs 3,4,5 [preset: w=5]",
"type": "int",
"default": 5
}
],
"call": "{package_name} {domain} {problem} -s {searchflag} -w {weightval}"
}
}
}
}
47 changes: 47 additions & 0 deletions planutils/packages/metric-ff-2.0/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# whatever command-line method needs to be used to run this package

FF=$(dirname $0)/metric-ff
if [ -z "$1" ]; then
cat << EOF
Planutils:
* First two arguments are <domain or operator> and <problem or facts>
* Extra arguments will be passed to Metric-FF

Original FF help:
EOF
$FF
exit 1
fi

# https://stackoverflow.com/questions/4632028/how-to-create-a-temporary-directory
WORK_DIR=`mktemp -d`

# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi

function cleanup {
rm -rf "$WORK_DIR"
# echo "Deleted temp working directory $WORK_DIR"
}
# register the cleanup function to be called on the EXIT signal
trap cleanup EXIT

OUT=$WORK_DIR/metric-ff.out
ERR=$WORK_DIR/metric-ff.err

DOMAIN=$1
PROBLEM=$2
shift 2
$FF -o $DOMAIN -f $PROBLEM $@ > $OUT 2>$ERR
# Getting plan
grep '[0-9]:' $OUT | cut -d : -f 2- | \
awk '{$1=$1;print}' | \
awk -F" " '{ print("(", $0, ")")}' > $PROBLEM.plan

cat $OUT >&1
cat $ERR >&2
3 changes: 3 additions & 0 deletions planutils/packages/metric-ff-2.0/uninstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

rm metric-ff
17 changes: 16 additions & 1 deletion planutils/packages/metric-ff/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,22 @@
"endpoint": {
"services": {
"solve": {
"template": "planner"
"template": "planner",
"args": [
{
"description": "Search configuration [preset: s=0]; '+H': helpful actions pruning\n 0 Standard-FF: EHC+H then BFS (cost minimization: NO)\n 1 BFS (cost minimization: NO)\n 2 BFS+H (cost minimization: NO)\n 3 Weighted A* (cost minimization: YES)\n 4 A*epsilon (cost minimization: YES)\n 5 EHC+H then A*epsilon (cost minimization: YES)",
"name": "searchflag",
"type": "int",
"default": 0
},
{
"name": "weightval",
"description": "Set weight w for search configs 3,4,5 [preset: w=5]",
"type": "int",
"default": 5
}
],
"call": "{package_name} {domain} {problem} -s {searchflag} -w {weightval}"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
long_description = fh.read()

setuptools.setup(name='planutils',
version='0.10.19',
version='0.10.20',
description='General library for setting up linux-based environments for developing, running, and evaluating planners.',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down