pddl_planner
Public Member Functions | Public Attributes | List of all members
pddl_planner::representation::Domain Struct Reference

An internal representation of a PDDL domain description. More...

#include <Domain.hpp>

Public Member Functions

 Domain (const std::string &name="")
 
void addType (const Type &type, const Type &parentType="")
 
void addConstant (const TypedItem &type, bool overwrite=false)
 
void addPredicate (const Predicate &predicate, bool overwrite=false)
 
void addRequirement (const Requirement &requirement)
 
void addAction (const Action &action, bool overwrite=false)
 
void addFunction (const Function &function, bool overwrite=false)
 
void removeConstant (const Label &label)
 
void removePredicate (const Label &label)
 
void removeAction (const Label &label)
 
void removeFunction (const Label &label)
 
bool isType (const Type &type) const
 
bool isConstant (const Label &label) const
 
bool isPredicate (const Label &label) const
 
bool isRequirement (const Requirement &requirement) const
 
bool isAction (const Label &label) const
 
bool isFunction (const Label &label) const
 
Predicate getPredicate (const Label &label) const
 
Action getAction (const Label &label) const
 
std::string toLISP () const
 
bool hasName () const
 
bool isNull () const
 
void validate (const Expression &e, const VariableManager &variableManager=VariableManager()) const
 
void validate () const
 

Public Attributes

std::string name
 
TypeList types
 
std::map< Type, Typetype2parent
 
ConstantList constants
 
PredicateList predicates
 
RequirementList requirements
 
ActionList actions
 
FunctionList functions
 

Detailed Description

An internal representation of a PDDL domain description.

This class allows to programmatically build a PDDL domain description and allow to export the current state in LISP format

Currently, the domain requires 'typing' support by default

Constructor & Destructor Documentation

◆ Domain()

pddl_planner::representation::Domain::Domain ( const std::string &  name = "")

Default domain constructor

Parameters
nameName of the domain

Member Function Documentation

◆ addAction()

void pddl_planner::representation::Domain::addAction ( const Action action,
bool  overwrite = false 
)

◆ addConstant()

void pddl_planner::representation::Domain::addConstant ( const TypedItem type,
bool  overwrite = false 
)

◆ addFunction()

void pddl_planner::representation::Domain::addFunction ( const Function function,
bool  overwrite = false 
)

◆ addPredicate()

void pddl_planner::representation::Domain::addPredicate ( const Predicate predicate,
bool  overwrite = false 
)

◆ addRequirement()

void pddl_planner::representation::Domain::addRequirement ( const Requirement requirement)

◆ addType()

void pddl_planner::representation::Domain::addType ( const Type type,
const Type parentType = "" 
)

Add a domain type

Parameters
typeType definition

◆ getAction()

Action pddl_planner::representation::Domain::getAction ( const Label label) const

◆ getPredicate()

Predicate pddl_planner::representation::Domain::getPredicate ( const Label label) const

◆ hasName()

bool pddl_planner::representation::Domain::hasName ( ) const
inline

Check if domain has a name

Returns
true if name is given, false otherwise

◆ isAction()

bool pddl_planner::representation::Domain::isAction ( const Label label) const

◆ isConstant()

bool pddl_planner::representation::Domain::isConstant ( const Label label) const

◆ isFunction()

bool pddl_planner::representation::Domain::isFunction ( const Label label) const

◆ isNull()

bool pddl_planner::representation::Domain::isNull ( ) const
inline

Check if a properly named domain definition is given

Returns
true if domain is defined, false otherwise

◆ isPredicate()

bool pddl_planner::representation::Domain::isPredicate ( const Label label) const

◆ isRequirement()

bool pddl_planner::representation::Domain::isRequirement ( const Requirement requirement) const

◆ isType()

bool pddl_planner::representation::Domain::isType ( const Type type) const

◆ removeAction()

void pddl_planner::representation::Domain::removeAction ( const Label label)

◆ removeConstant()

void pddl_planner::representation::Domain::removeConstant ( const Label label)

◆ removeFunction()

void pddl_planner::representation::Domain::removeFunction ( const Label label)

◆ removePredicate()

void pddl_planner::representation::Domain::removePredicate ( const Label label)

◆ toLISP()

std::string pddl_planner::representation::Domain::toLISP ( ) const

◆ validate() [1/2]

void pddl_planner::representation::Domain::validate ( const Expression e,
const VariableManager variableManager = VariableManager() 
) const

Validate an expression using a given variable manager

Exceptions
std::runtime_errorif expression is not properly defined

◆ validate() [2/2]

void pddl_planner::representation::Domain::validate ( ) const

Perform a simple syntax check

Exceptions
std::runtime_errorif expression is not properly defined

Member Data Documentation

◆ actions

ActionList pddl_planner::representation::Domain::actions

◆ constants

ConstantList pddl_planner::representation::Domain::constants

◆ functions

FunctionList pddl_planner::representation::Domain::functions

◆ name

std::string pddl_planner::representation::Domain::name

◆ predicates

PredicateList pddl_planner::representation::Domain::predicates

◆ requirements

RequirementList pddl_planner::representation::Domain::requirements

◆ type2parent

std::map<Type,Type> pddl_planner::representation::Domain::type2parent

◆ types

TypeList pddl_planner::representation::Domain::types

The documentation for this struct was generated from the following files: