From fa69635b214540b5651bad38730331f995ca9747 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Thu, 12 Sep 2019 15:07:30 +0200
Subject: [PATCH] Removed mvt from transitions

---
 transition_machine/include/TransitionMachine.hpp | 5 +----
 transition_machine/src/TransitionMachine.cpp     | 9 +++------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/transition_machine/include/TransitionMachine.hpp b/transition_machine/include/TransitionMachine.hpp
index d273603..37c9328 100644
--- a/transition_machine/include/TransitionMachine.hpp
+++ b/transition_machine/include/TransitionMachine.hpp
@@ -27,15 +27,12 @@ class TransitionMachine
     std::string dest;
     /// @brief The prefix of the Action name that will trigger the choice of this Transition.
     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.
     ///
     /// @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 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, int mvt);
+    Transition(const std::string & dest, const std::string & prefix);
   };
 
   /// @brief A State of the TransitionMachine. Can be seen as a graph node.
diff --git a/transition_machine/src/TransitionMachine.cpp b/transition_machine/src/TransitionMachine.cpp
index b61c1ea..c7cebf6 100644
--- a/transition_machine/src/TransitionMachine.cpp
+++ b/transition_machine/src/TransitionMachine.cpp
@@ -80,9 +80,7 @@ TransitionMachine::TransitionMachine(bool trainMode)
   if(buffer != std::string("TRANSITIONS"))
     badFormatAndAbort(ERRINFO);
 
-  // Reading all transitions
-  int mvt;
-  while(fscanf(fd, "%s %s %d %[^\n]\n", buffer, buffer2, &mvt, buffer3) == 4)
+  while(fscanf(fd, "%s %s %[^\n]\n", buffer, buffer2, buffer3) == 3)
   {
     std::string src(buffer);
     std::string dest(buffer2);
@@ -96,7 +94,7 @@ TransitionMachine::TransitionMachine(bool trainMode)
 
     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
   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->actionPrefix = prefix;
-  this->headMvt = mvt;
 }
 
 std::string & TransitionMachine::getCurrentState()
-- 
GitLab