#include <vector>
#include <string>
+#include <ext/hash_map>
typedef std::vector<std::string> literals;
+typedef std::vector<std::pair<std::string,literals> > preconditionsVector;
+typedef __gnu_cxx::hash_map<int,literals> effectsMap;
class Action {
public:
- Action(std::string executable, literals preconditions, literals effects);
+ Action(std::string name, preconditionsVector preconditions, effectsMap effects);
Action(const Action& action);
Action(){};
- const literals& effects() const;
+ const literals& effects(int value) const;
const literals& preconditions() const;
- const std::string& executable() const;
+ const std::string& name() const;
+ bool nextExecutable();
int execute() const;
+ void reset();
protected:
- std::string _executable;
- literals _preconditions;
- literals _effects;
+ preconditionsVector::const_iterator _currentPrecondition;
+ std::string _name;
+ preconditionsVector _preconditions;
+ effectsMap _effects;
+ static const literals _empty;
};
#endif