From bbb847ee66f87a70b5b48e05365ddc536b058ceb Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Fri, 14 Feb 2020 14:20:24 +0100 Subject: [PATCH] Fixed movement in strategy --- reading_machine/src/Strategy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reading_machine/src/Strategy.cpp b/reading_machine/src/Strategy.cpp index ea537e0..14853d3 100644 --- a/reading_machine/src/Strategy.cpp +++ b/reading_machine/src/Strategy.cpp @@ -65,7 +65,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co auto foundGeneric = edges.find(std::make_pair(c.getState(), "")); std::string target; - int movement; + int movement = -1; if (foundSpecific != edges.end()) { @@ -82,7 +82,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co util::myThrow(fmt::format("no suitable movement found for current state '{}' and transition '{}'", c.getState(), transition)); if (!c.stateIsDone()) - return {c.getState(), (c.getState() == target) && edges.size() > 1 ? movement : 0}; + return {c.getState(), movement}; if (!isDone[target]) return {target, -c.getWordIndex()}; -- GitLab