Skip to content

Instantly share code, notes, and snippets.

@Nirav-Madhani
Last active September 2, 2024 20:26
Show Gist options
  • Select an option

  • Save Nirav-Madhani/106de0e3ba4269bedad928d1217c5545 to your computer and use it in GitHub Desktop.

Select an option

Save Nirav-Madhani/106de0e3ba4269bedad928d1217c5545 to your computer and use it in GitHub Desktop.
Fast Downward Docker

PDDL for Window Using Docker

Overview

Main Objective is to get around complexity associated with setting up FastDownward in Windows Machine. This batch script is designed to automate the execution of planning tasks using the Planning Domain Definition Language (PDDL) within a Docker environment. It uses the AI Basel 'downward' Docker container to process specified domain and problem files, and manages the entire workflow from execution to output retrieval.

Prerequisites

  • Docker must be installed on your machine.
  • Access to the AI Basel 'downward' Docker image must be ensured.

Usage

To run the script, provide the path to both the domain file and the problem file as arguments:

dwd domain.pddl problem.pddl

Output Details

  • result.txt: Contains the resultant planning solution.
  • log.txt: Includes detailed logs from the planning process for troubleshooting and verification purposes.
  • Script is hardcoded to use --alias lama-first domain.pddl problem.pddl but modifications can be made at line 13 and while accepting args to make it more dynamic

Notes

  • Ensure the Docker daemon is running before executing the script.
  • For troubleshooting, refer to log.txt to review execution logs and verify proper paths and permissions if issues arise.
@echo off
REM Check if the correct number of arguments is provided
IF "%~2"=="" (
echo Usage: %0 domain.pddl problem.pddl
exit /b 1
)
REM Assign arguments to variables
SET DOMAIN_FILE=%~1
SET PROBLEM_FILE=%~2
REM Run the Docker container with the provided PDDL files
docker run -it -v %cd%:/workspace/downward/A1 --name downward-container aibasel/downward --alias lama-first "A1/%DOMAIN_FILE%" "A1/%PROBLEM_FILE%" > log.txt
REM Copy the output file from the container to the host
docker cp downward-container:/workspace/downward/sas_plan result.txt
REM Remove the Docker container
docker rm downward-container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment