Fawkes API  Fawkes Development Version
fawkes::stn::Stn Class Reference

A Simple Temporal Network. More...

#include "stn.h"

Public Member Functions

 Stn (fawkes::Logger *logger)
 Constructor. More...
 
 Stn (fawkes::Logger *logger, const std::string &classic_dom_path)
 Constructor. More...
 
virtual ~Stn ()
 Destructor. More...
 
void add_plan_action (const std::string &name, const std::string &params)
 Add a (grounded action). More...
 
void set_initial_state (const StnAction &action)
 Set the initial state. More...
 
void read_initial_state (const std::string &pddl_problem_string)
 Read the initial state from the given PDDL problem. More...
 
void set_pddl_domain (const std::string &pddl_domain_string)
 Set the domain of the STN to the given PDDL domain. More...
 
void generate ()
 Regenerate the STN. More...
 
void drawGraph ()
 Render a graph representation of the STN. More...
 
std::vector< bsoncxx::document::value > get_bson ()
 Get a BSON representation of the STN. More...
 

Detailed Description

A Simple Temporal Network.

Definition at line 42 of file stn.h.

Constructor & Destructor Documentation

◆ Stn() [1/2]

fawkes::stn::Stn::Stn ( fawkes::Logger logger)

Constructor.

Parameters
loggerThe logger to log to.

Definition at line 41 of file stn.cpp.

◆ Stn() [2/2]

fawkes::stn::Stn::Stn ( fawkes::Logger logger,
const std::string &  classic_dom_path 
)

Constructor.

Parameters
loggerThe logger to log to.
classic_dom_pathThe path to the domain file to write to.

Definition at line 49 of file stn.cpp.

◆ ~Stn()

fawkes::stn::Stn::~Stn ( )
virtual

Destructor.

Definition at line 56 of file stn.cpp.

Member Function Documentation

◆ add_plan_action()

void fawkes::stn::Stn::add_plan_action ( const std::string &  name,
const std::string &  params 
)

Add a (grounded action).

Parameters
nameThe name of the action/operator.
paramsThe parameters of the action.

Definition at line 74 of file stn.cpp.

Referenced by StnGeneratorThread::loop().

◆ drawGraph()

void fawkes::stn::Stn::drawGraph ( )

Render a graph representation of the STN.

This writes the graph representation to the file stn.png.

Definition at line 303 of file stn.cpp.

Referenced by StnGeneratorThread::loop().

◆ generate()

void fawkes::stn::Stn::generate ( )

Regenerate the STN.

Definition at line 209 of file stn.cpp.

References fawkes::stn::DomainAction::generateStnAction().

Referenced by StnGeneratorThread::loop().

◆ get_bson()

std::vector< bsoncxx::document::value > fawkes::stn::Stn::get_bson ( )

Get a BSON representation of the STN.

Returns
A vector of BSON objects, each element is an action.

Definition at line 361 of file stn.cpp.

◆ read_initial_state()

void fawkes::stn::Stn::read_initial_state ( const std::string &  pddl_problem_string)

Read the initial state from the given PDDL problem.

Parameters
pddl_problem_stringthe PDDL rpboelm as (unparsed) string.

Definition at line 94 of file stn.cpp.

References pddl_parser::Problem::init, pddl_parser::Problem::name, pddl_parser::PddlParser::parseProblem(), and set_initial_state().

Referenced by StnGeneratorThread::loop().

◆ set_initial_state()

void fawkes::stn::Stn::set_initial_state ( const StnAction action)

Set the initial state.

The resulting initial state is the state after applying the effects of the given action.

Parameters
actionThe action whose effects define the initial state.

Definition at line 85 of file stn.cpp.

Referenced by read_initial_state().

◆ set_pddl_domain()

void fawkes::stn::Stn::set_pddl_domain ( const std::string &  pddl_domain_string)

Set the domain of the STN to the given PDDL domain.

This parses the given domain and processes all actions in the domain. It also adds all temporal and conditional breakups defined in the domain to the STN.

Parameters
pddl_domain_stringthe PDDL domain as (unparsed) string.

Definition at line 127 of file stn.cpp.

References pddl_parser::Domain::actions, and pddl_parser::PddlParser::parseDomain().

Referenced by StnGeneratorThread::init().


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