Skip to content

Quick Start

RukNdf edited this page Mar 16, 2021 · 8 revisions

Implementation

Basic usage only requires the implementation of a few parsing functions and validation methods.

1. Parsing.

Parsing requires using the Parser functions to create and initialize a PDDL object from pddl files.

Example

//pddl files
String domain_file = "domain.pddl";
String problem_file = "problem.pddl";
String plan_file = "plan.pddl";

//parses the domain
PDDL pddl_object = parseDomain( domain_file );
//parses the problem
parseProblem( pddl_object, problem_file );
//parses the plan
parsePlan( pddl_object, plan_file );

2. Validation

The validation uses methods from the PDDL object to test and sequentially apply each action from the plan. The program can either output the the process straight to the terminal during runtime, or create a LaTeX report afterwards.

The terminal method uses prints to output the information straight to the terminal.

Example

//checks for errors 
boolean no_errors = !pddl_object.checkA();
if(no_errors){
	//Prints the domain
	pddl_object.printDomain();
	//Prints the domain and plan
	pddl_object.printProbPl();
	//Applies the plan and prints any errors
	pddl_object.planTest();
}

The report method uses the template file "template" to generate a LaTeX report.

Example

//checks for errors 
boolean no_errors = !pddl_object.checkA();
if(no_errors){
	//latex output file
	String output_file = "output.tex";
	//validates the plan and outputs the result
	pddl_object.valOut(output_file );
}

Modifying files

The program relies on 3 automatically generated java files, Parser.java and ParserVal.java, and Yylex.java. These files should be modified at the source files (Domain.y and Domain.flex, respectively) to prevent parsing bugs and to facilitate further modifications.

All other files can be modified directly.

Clone this wiki locally