Action.cpp
Go to the documentation of this file.
00001 #include <actasp/Action.h>
00002 
00003 #include <sstream>
00004 
00005 using namespace std;
00006 
00007 namespace actasp {
00008         
00009         
00010 std::string Action::toASP(unsigned int timeStep) const {
00011         
00012         stringstream nameS;
00013         
00014         nameS << this->getName() << "(";
00015 
00016         for(int i=0, size=this->getParameters().size(); i<size ; ++i)
00017                 nameS << this->getParameters()[i] << ",";
00018 
00019         nameS << timeStep <<")";
00020         
00021         return nameS.str();
00022         
00023 }
00024 
00025 AspFluent Action::toFluent(unsigned int timeStep) const {
00026   
00027   if(this->getParameters().size() != this->paramNumber()) {
00028     //the action has not been initilized yet, using a vector of placeHolders
00029     return AspFluent(this->getName(),vector<string>(this->paramNumber()), timeStep);
00030   }
00031   else
00032     return AspFluent(this->getName(),this->getParameters(), timeStep);
00033    
00034 }
00035 
00036         
00037 }


bwi_kr_execution
Author(s): Matteo Leonetti, Piyush Khandelwal
autogenerated on Fri Aug 28 2015 10:14:46