2016-05-24 16:03:08 +02:00
|
|
|
#ifndef __PLASP__SAS__EFFECT_H
|
|
|
|
#define __PLASP__SAS__EFFECT_H
|
2016-05-20 15:29:24 +02:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2017-06-22 20:58:31 +02:00
|
|
|
#include <tokenize/Tokenizer.h>
|
|
|
|
|
2016-05-22 14:24:38 +02:00
|
|
|
#include <plasp/sas/AssignedVariable.h>
|
2016-05-20 15:29:24 +02:00
|
|
|
#include <plasp/sas/Variable.h>
|
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
namespace sas
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Effect
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-05-22 15:46:41 +02:00
|
|
|
class Effect;
|
2016-05-22 14:24:38 +02:00
|
|
|
using Effects = std::vector<Effect>;
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-05-22 15:46:41 +02:00
|
|
|
class Effect
|
2016-05-20 15:29:24 +02:00
|
|
|
{
|
2016-05-22 15:46:41 +02:00
|
|
|
public:
|
|
|
|
using Condition = AssignedVariable;
|
|
|
|
using Conditions = AssignedVariables;
|
2016-05-20 15:29:24 +02:00
|
|
|
|
2017-05-12 14:17:57 +02:00
|
|
|
static Effect fromSAS(tokenize::Tokenizer<> &tokenizer, const Variables &variables, Conditions &preconditions);
|
2016-05-22 15:46:41 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
const Conditions &conditions() const;
|
|
|
|
const Condition &postcondition() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Effect() = default;
|
|
|
|
explicit Effect(Conditions conditions, Condition postcondition);
|
|
|
|
|
|
|
|
Conditions m_conditions;
|
|
|
|
Condition m_postcondition;
|
2016-05-20 15:29:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|