5 using namespace __gnu_cxx;
7 const Literals Action::_empty;
9 Action::Action(std::string name,const Preconditions& preconditions, std::string executable,const EffectsMap& effects){
11 _executable = executable;
12 _preconditions = preconditions;
16 Action::Action(const Action& action){
18 _preconditions = action._preconditions;
19 _effects = action._effects;
20 _executable = action._executable;
23 const Literals& Action::effects(int value) const{
24 EffectsMap::const_iterator effects = _effects.find(value);
25 if (effects != _effects.end())
26 return effects->second;
30 const Preconditions& Action::preconditions() const{
31 return _preconditions;
34 int Action::execute() const{
35 cout << "Executing: " << _name << endl;
36 return system(_executable.c_str());
39 const string& Action::name() const{