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
10 changes: 5 additions & 5 deletions blocksworld/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ subdirectory. The directories 3ops/2pddl and 4ops/2pddl contain
programs that translate the generator's output to PDDL. The random
instances can then be generated by running the script

./blocksworld <ops> <num>
./blocksworld <ops> <num> <seed>

which takes as input the number of operators (either 3 or 4) and blocks
in the problem to be generated. This is currently maximal 200 due to
the random state generator. To increase that, edit the Makefile in
bwstates.1 and increase SIZE.
which takes as input the number of operators (either 3 or 4), blocks
in the problem to be generated, and a random seed for reproducibility.
The number of blocks is currently limited to 200 due to the random state generator.
To increase that, edit the Makefile in bwstates.1 and increase SIZE.

## Blocksworld-3ops

Expand Down
3 changes: 2 additions & 1 deletion blocksworld/blocksworld
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ set -euo pipefail

OPS=$1 # Either 3 or 4.
BLOCKS=$2
SEED=$3

# Get full directory name of the script (https://stackoverflow.com/a/246128).
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

BS=${SCRIPT_DIR}/bwstates.1/bwstates
TR=${SCRIPT_DIR}/${OPS}ops/2pddl/2pddl

${BS} -s 2 -n ${BLOCKS} > STATES
${BS} -s 2 -n ${BLOCKS} -r ${SEED} > STATES
${TR} -d STATES -n ${BLOCKS}

rm STATES
6 changes: 3 additions & 3 deletions blocksworld/matching/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ You also need to make sure that the shell script is executable via:

chmod +x matching-bw-generator.sh

Then to generate a matching-bw problem with base name "bname" and size
"n" you can call:
Then to generate a matching-bw problem with base name "bname", size
"n", and random seed "s" you can call:

./matching-bw-generator.sh bname n
./matching-bw-generator.sh bname n s

This will create two files: bname-typed.pddl and bname-untyped.pddl

Expand Down
4 changes: 2 additions & 2 deletions blocksworld/matching/matching-bw-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set -euo pipefail

cd "$(dirname "$0")"

./../bwstates.1/bwstates -n $2 > temp.blocks || true
./../bwstates.1/bwstates -n $2 >> temp.blocks || true
./../bwstates.1/bwstates -n $2 -r $3 > temp.blocks || true
./../bwstates.1/bwstates -n $2 -r $3 >> temp.blocks || true

./2pddl-typed -d temp.blocks -n $2 > $1-typed.pddl
./2pddl-untyped -d temp.blocks -n $2 > $1-untyped.pddl
Expand Down