Started implementation of PDDL problem parser.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <plasp/pddl/Domain.h>
|
||||
#include <plasp/pddl/Problem.h>
|
||||
#include <plasp/utils/Parser.h>
|
||||
|
||||
namespace plasp
|
||||
@@ -36,7 +37,7 @@ class Description
|
||||
Context m_context;
|
||||
|
||||
std::unique_ptr<Domain> m_domain;
|
||||
//std::unique_ptr<Problem> m_problem;
|
||||
std::unique_ptr<Problem> m_problem;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
50
include/plasp/pddl/Problem.h
Normal file
50
include/plasp/pddl/Problem.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef __PLASP__PDDL__PROBLEM_H
|
||||
#define __PLASP__PDDL__PROBLEM_H
|
||||
|
||||
#include <plasp/pddl/Context.h>
|
||||
#include <plasp/pddl/Expression.h>
|
||||
#include <plasp/pddl/Requirement.h>
|
||||
|
||||
namespace plasp
|
||||
{
|
||||
namespace pddl
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Problem
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Problem
|
||||
{
|
||||
public:
|
||||
static Problem fromPDDL(Context &context);
|
||||
|
||||
public:
|
||||
const std::string &name() const;
|
||||
const Requirements &requirements() const;
|
||||
|
||||
private:
|
||||
Problem(Context &context);
|
||||
|
||||
void parseSection();
|
||||
|
||||
void parseRequirementSection();
|
||||
bool hasRequirement(Requirement::Type requirementType) const;
|
||||
void computeDerivedRequirements();
|
||||
|
||||
void checkConsistency();
|
||||
|
||||
Context &m_context;
|
||||
|
||||
std::string m_name;
|
||||
Requirements m_requirements;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user