2016-05-24 16:03:08 +02:00
|
|
|
#ifndef __PLASP__SAS__OPERATOR_H
|
|
|
|
#define __PLASP__SAS__OPERATOR_H
|
2016-05-20 15:29:24 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2016-05-22 14:24:38 +02:00
|
|
|
#include <plasp/sas/AssignedVariable.h>
|
2016-05-20 15:29:24 +02:00
|
|
|
#include <plasp/sas/Effect.h>
|
2016-05-21 02:03:45 +02:00
|
|
|
#include <plasp/sas/Predicate.h>
|
2016-05-20 15:29:24 +02:00
|
|
|
#include <plasp/sas/Variable.h>
|
2016-05-27 03:58:59 +02:00
|
|
|
#include <plasp/utils/Parser.h>
|
2016-05-20 15:29:24 +02:00
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
namespace sas
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Operator
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-05-22 14:35:53 +02:00
|
|
|
class Operator;
|
2016-05-22 14:24:38 +02:00
|
|
|
using Operators = std::vector<Operator>;
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-05-22 14:35:53 +02:00
|
|
|
class Operator
|
2016-05-20 15:29:24 +02:00
|
|
|
{
|
2016-05-22 14:35:53 +02:00
|
|
|
public:
|
|
|
|
using Condition = AssignedVariable;
|
|
|
|
using Conditions = AssignedVariables;
|
|
|
|
|
2016-05-27 03:58:59 +02:00
|
|
|
static Operator fromSAS(utils::Parser &parser, const Variables &variables);
|
2016-05-22 14:43:57 +02:00
|
|
|
|
2016-05-22 14:35:53 +02:00
|
|
|
public:
|
2016-05-23 16:28:06 +02:00
|
|
|
void printPredicateAsASP(std::ostream &ostream) const;
|
|
|
|
|
2016-05-22 14:35:53 +02:00
|
|
|
const Predicate &predicate() const;
|
|
|
|
const Conditions &preconditions() const;
|
|
|
|
const Effects &effects() const;
|
|
|
|
size_t costs() const;
|
|
|
|
|
|
|
|
private:
|
2016-05-22 14:45:31 +02:00
|
|
|
Operator() = default;
|
|
|
|
|
2016-05-22 14:35:53 +02:00
|
|
|
Predicate m_predicate;
|
|
|
|
Conditions m_preconditions;
|
|
|
|
Effects m_effects;
|
|
|
|
size_t m_costs;
|
2016-05-20 15:29:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|