This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/include/plasp/sas/Operator.h

60 lines
1.3 KiB
C
Raw Normal View History

#ifndef __PLASP__SAS__OPERATOR_H
#define __PLASP__SAS__OPERATOR_H
2016-05-20 15:29:24 +02:00
#include <string>
#include <vector>
#include <plasp/sas/AssignedVariable.h>
2016-05-20 15:29:24 +02:00
#include <plasp/sas/Effect.h>
#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;
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:
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