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

Fixed movement in strategy

parent 9bc1ea8d
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co ...@@ -65,7 +65,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co
auto foundGeneric = edges.find(std::make_pair(c.getState(), "")); auto foundGeneric = edges.find(std::make_pair(c.getState(), ""));
std::string target; std::string target;
int movement; int movement = -1;
if (foundSpecific != edges.end()) if (foundSpecific != edges.end())
{ {
...@@ -82,7 +82,7 @@ std::pair<std::string, int> Strategy::getMovementSequential(const Config & c, co ...@@ -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)); util::myThrow(fmt::format("no suitable movement found for current state '{}' and transition '{}'", c.getState(), transition));
if (!c.stateIsDone()) if (!c.stateIsDone())
return {c.getState(), (c.getState() == target) && edges.size() > 1 ? movement : 0}; return {c.getState(), movement};
if (!isDone[target]) if (!isDone[target])
return {target, -c.getWordIndex()}; return {target, -c.getWordIndex()};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment