2016-05-29 16:27:11 +02:00
|
|
|
#ifndef __PLASP__PDDL__DESCRIPTION_H
|
|
|
|
#define __PLASP__PDDL__DESCRIPTION_H
|
|
|
|
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
|
|
|
|
#include <plasp/pddl/Domain.h>
|
2016-06-04 17:53:42 +02:00
|
|
|
#include <plasp/pddl/Problem.h>
|
2016-05-29 16:27:11 +02:00
|
|
|
#include <plasp/utils/Parser.h>
|
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
namespace pddl
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Description
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class Description
|
|
|
|
{
|
|
|
|
public:
|
2016-06-13 14:45:31 +02:00
|
|
|
static Description fromContext(Context &&context);
|
2016-05-29 16:27:11 +02:00
|
|
|
static Description fromStream(std::istream &istream);
|
2016-06-08 13:41:17 +02:00
|
|
|
static Description fromFile(const std::string &path);
|
2016-06-07 15:54:01 +02:00
|
|
|
static Description fromFiles(const std::vector<std::string> &paths);
|
2016-05-29 16:27:11 +02:00
|
|
|
|
|
|
|
public:
|
2016-06-13 14:45:31 +02:00
|
|
|
Context &context();
|
|
|
|
const Context &context() const;
|
|
|
|
|
2016-05-30 15:44:13 +02:00
|
|
|
const Domain &domain() const;
|
2016-06-10 17:26:36 +02:00
|
|
|
|
|
|
|
bool containsProblem() const;
|
2016-06-08 13:52:36 +02:00
|
|
|
const Problem &problem() const;
|
2016-05-29 16:27:11 +02:00
|
|
|
|
2016-08-18 00:24:10 +02:00
|
|
|
void normalizeParameterNames();
|
|
|
|
|
2016-05-29 16:27:11 +02:00
|
|
|
private:
|
2016-06-07 18:41:01 +02:00
|
|
|
Description();
|
2016-05-29 16:27:11 +02:00
|
|
|
|
2016-06-13 14:45:31 +02:00
|
|
|
void parse();
|
2016-06-08 00:34:59 +02:00
|
|
|
void findSections();
|
2016-05-29 16:27:11 +02:00
|
|
|
|
2016-06-07 13:26:19 +02:00
|
|
|
void checkConsistency();
|
|
|
|
|
2016-05-31 01:06:57 +02:00
|
|
|
Context m_context;
|
2016-06-04 16:10:11 +02:00
|
|
|
|
2016-08-02 19:58:54 +02:00
|
|
|
utils::Stream::Position m_domainPosition;
|
2016-05-29 16:27:11 +02:00
|
|
|
std::unique_ptr<Domain> m_domain;
|
2016-08-02 19:58:54 +02:00
|
|
|
utils::Stream::Position m_problemPosition;
|
2016-06-04 17:53:42 +02:00
|
|
|
std::unique_ptr<Problem> m_problem;
|
2016-05-29 16:27:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|