Introduced consistent aliases for vector types.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define __SAS__ASSIGNED_VARIABLE_H
|
||||
|
||||
#include <iosfwd>
|
||||
#include <vector>
|
||||
|
||||
#include <plasp/sas/Value.h>
|
||||
#include <plasp/sas/Variable.h>
|
||||
@@ -17,10 +18,15 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class AssignedVariable;
|
||||
using AssignedVariables = std::vector<AssignedVariable>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class AssignedVariable
|
||||
{
|
||||
public:
|
||||
static AssignedVariable fromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static AssignedVariable fromSAS(std::istream &istream, const Variables &variables);
|
||||
static AssignedVariable fromSAS(std::istream &istream, const Variable &variable);
|
||||
|
||||
public:
|
||||
|
@@ -17,10 +17,15 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct AxiomRule;
|
||||
using AxiomRules = std::vector<AxiomRule>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct AxiomRule
|
||||
{
|
||||
using Condition = AssignedVariable;
|
||||
using Conditions = std::vector<Condition>;
|
||||
using Conditions = AssignedVariables;
|
||||
|
||||
Conditions conditions;
|
||||
Condition postcondition;
|
||||
|
@@ -33,12 +33,12 @@ class Description
|
||||
|
||||
public:
|
||||
bool usesActionCosts() const;
|
||||
const std::vector<Variable> &variables() const;
|
||||
const std::vector<MutexGroup> &mutexGroups() const;
|
||||
const Variables &variables() const;
|
||||
const MutexGroups &mutexGroups() const;
|
||||
const InitialState &initialState() const;
|
||||
const Goal &goal() const;
|
||||
const std::vector<Operator> &operators() const;
|
||||
const std::vector<AxiomRule> &axiomRules() const;
|
||||
const Operators &operators() const;
|
||||
const AxiomRules &axiomRules() const;
|
||||
|
||||
void print(std::ostream &ostream) const;
|
||||
|
||||
@@ -56,12 +56,12 @@ class Description
|
||||
|
||||
bool m_usesActionCosts;
|
||||
|
||||
std::vector<Variable> m_variables;
|
||||
std::vector<MutexGroup> m_mutexGroups;
|
||||
Variables m_variables;
|
||||
MutexGroups m_mutexGroups;
|
||||
std::unique_ptr<InitialState> m_initialState;
|
||||
std::unique_ptr<Goal> m_goal;
|
||||
std::vector<Operator> m_operators;
|
||||
std::vector<AxiomRule> m_axiomRules;
|
||||
Operators m_operators;
|
||||
AxiomRules m_axiomRules;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <plasp/sas/AssignedVariable.h>
|
||||
#include <plasp/sas/Variable.h>
|
||||
|
||||
namespace plasp
|
||||
@@ -16,10 +17,15 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Effect;
|
||||
using Effects = std::vector<Effect>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Effect
|
||||
{
|
||||
using Condition = AssignedVariable;
|
||||
using Conditions = std::vector<Condition>;
|
||||
using Conditions = AssignedVariables;
|
||||
|
||||
Conditions conditions;
|
||||
Condition postcondition;
|
||||
|
@@ -18,9 +18,9 @@ class Goal
|
||||
{
|
||||
public:
|
||||
using Fact = AssignedVariable;
|
||||
using Facts = std::vector<Fact>;
|
||||
using Facts = AssignedVariables;
|
||||
|
||||
static Goal fromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static Goal fromSAS(std::istream &istream, const Variables &variables);
|
||||
|
||||
public:
|
||||
const Facts &facts() const;
|
||||
|
@@ -18,9 +18,9 @@ class InitialState
|
||||
{
|
||||
public:
|
||||
using Fact = AssignedVariable;
|
||||
using Facts = std::vector<Fact>;
|
||||
using Facts = AssignedVariables;
|
||||
|
||||
static InitialState fromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static InitialState fromSAS(std::istream &istream, const Variables &variables);
|
||||
|
||||
public:
|
||||
const Facts &facts() const;
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#ifndef __SAS__MUTEX_GROUP_H
|
||||
#define __SAS__MUTEX_GROUP_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <plasp/sas/AssignedVariable.h>
|
||||
|
||||
namespace plasp
|
||||
@@ -14,13 +16,18 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MutexGroup;
|
||||
using MutexGroups = std::vector<MutexGroup>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MutexGroup
|
||||
{
|
||||
public:
|
||||
using Fact = AssignedVariable;
|
||||
using Facts = std::vector<Fact>;
|
||||
using Facts = AssignedVariables;
|
||||
|
||||
static MutexGroup fromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static MutexGroup fromSAS(std::istream &istream, const Variables &variables);
|
||||
|
||||
public:
|
||||
const Facts &facts() const;
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <plasp/sas/AssignedVariable.h>
|
||||
#include <plasp/sas/Effect.h>
|
||||
#include <plasp/sas/Predicate.h>
|
||||
#include <plasp/sas/Variable.h>
|
||||
@@ -19,11 +20,15 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Operator;
|
||||
using Operators = std::vector<Operator>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Operator
|
||||
{
|
||||
using Condition = AssignedVariable;
|
||||
using Conditions = std::vector<Condition>;
|
||||
using Effects = std::vector<Effect>;
|
||||
using Conditions = AssignedVariables;
|
||||
|
||||
Predicate predicate;
|
||||
Conditions preconditions;
|
||||
|
@@ -19,6 +19,11 @@ class Variable;
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Value;
|
||||
using Values = std::vector<Value>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct Value
|
||||
{
|
||||
public:
|
||||
@@ -53,10 +58,6 @@ struct Value
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
using Values = std::vector<Value>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,11 +18,16 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Variable;
|
||||
using Variables = std::vector<Variable>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class Variable
|
||||
{
|
||||
public:
|
||||
static Variable fromSAS(std::istream &istream);
|
||||
static const Variable &referenceFromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static const Variable &referenceFromSAS(std::istream &istream, const Variables &variables);
|
||||
|
||||
public:
|
||||
const std::string &name() const;
|
||||
|
@@ -17,10 +17,15 @@ namespace sas
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class VariableTransition;
|
||||
using VariableTransitions = std::vector<VariableTransition>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class VariableTransition
|
||||
{
|
||||
public:
|
||||
static VariableTransition fromSAS(std::istream &istream, const std::vector<Variable> &variables);
|
||||
static VariableTransition fromSAS(std::istream &istream, const Variables &variables);
|
||||
|
||||
public:
|
||||
const Variable &variable() const;
|
||||
|
Reference in New Issue
Block a user