Skip to content
Snippets Groups Projects
Commit fa69635b authored by Franck Dary's avatar Franck Dary
Browse files

Removed mvt from transitions

parent f97310f3
No related branches found
No related tags found
No related merge requests found
...@@ -27,15 +27,12 @@ class TransitionMachine ...@@ -27,15 +27,12 @@ class TransitionMachine
std::string dest; std::string dest;
/// @brief The prefix of the Action name that will trigger the choice of this Transition. /// @brief The prefix of the Action name that will trigger the choice of this Transition.
std::string actionPrefix; std::string actionPrefix;
/// @brief The relative movement that will be applied to the Config head when taking this transition.
int headMvt;
/// @brief Construct a new Transition. /// @brief Construct a new Transition.
/// ///
/// @param dest The other end of the Transition. /// @param dest The other end of the Transition.
/// @param prefix The prefix of the Action name that will trigger the choice of this Transition. /// @param prefix The prefix of the Action name that will trigger the choice of this Transition.
/// @param mvt The relative movement that will be applied to the Config head when taking this transition. Transition(const std::string & dest, const std::string & prefix);
Transition(const std::string & dest, const std::string & prefix, int mvt);
}; };
/// @brief A State of the TransitionMachine. Can be seen as a graph node. /// @brief A State of the TransitionMachine. Can be seen as a graph node.
......
...@@ -80,9 +80,7 @@ TransitionMachine::TransitionMachine(bool trainMode) ...@@ -80,9 +80,7 @@ TransitionMachine::TransitionMachine(bool trainMode)
if(buffer != std::string("TRANSITIONS")) if(buffer != std::string("TRANSITIONS"))
badFormatAndAbort(ERRINFO); badFormatAndAbort(ERRINFO);
// Reading all transitions while(fscanf(fd, "%s %s %[^\n]\n", buffer, buffer2, buffer3) == 3)
int mvt;
while(fscanf(fd, "%s %s %d %[^\n]\n", buffer, buffer2, &mvt, buffer3) == 4)
{ {
std::string src(buffer); std::string src(buffer);
std::string dest(buffer2); std::string dest(buffer2);
...@@ -96,7 +94,7 @@ TransitionMachine::TransitionMachine(bool trainMode) ...@@ -96,7 +94,7 @@ TransitionMachine::TransitionMachine(bool trainMode)
State * srcState = str2state[src].get(); State * srcState = str2state[src].get();
srcState->transitions.emplace_back(dest, prefix, mvt); srcState->transitions.emplace_back(dest, prefix);
} }
} }
...@@ -106,11 +104,10 @@ TransitionMachine::State::State(const std::string & name, const std::string & cl ...@@ -106,11 +104,10 @@ TransitionMachine::State::State(const std::string & name, const std::string & cl
this->classifier = classifier; this->classifier = classifier;
} }
TransitionMachine::Transition::Transition(const std::string & dest, const std::string & prefix, int mvt) TransitionMachine::Transition::Transition(const std::string & dest, const std::string & prefix)
{ {
this->dest = dest; this->dest = dest;
this->actionPrefix = prefix; this->actionPrefix = prefix;
this->headMvt = mvt;
} }
std::string & TransitionMachine::getCurrentState() std::string & TransitionMachine::getCurrentState()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment