From e44d0dfa0bb8277d548e77ad5c4571105d5bd679 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Fri, 14 Feb 2020 14:32:29 +0100
Subject: [PATCH] In Decoder::decode : predicted transition has to be appliable

---
 decoder/src/Decoder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/decoder/src/Decoder.cpp b/decoder/src/Decoder.cpp
index 08f4de8..bcb25bd 100644
--- a/decoder/src/Decoder.cpp
+++ b/decoder/src/Decoder.cpp
@@ -28,7 +28,7 @@ void Decoder::decode(BaseConfig & config, std::size_t beamSize, bool debug)
     int chosenTransition = -1;
 
     for (unsigned int i = 0; i < prediction.size(0); i++)
-      if ((chosenTransition == -1 or prediction[i].item<float>() > prediction[chosenTransition].item<float>()) and machine.getTransitionSet().getTransition(i))
+      if ((chosenTransition == -1 or prediction[i].item<float>() > prediction[chosenTransition].item<float>()) and machine.getTransitionSet().getTransition(i)->appliable(config))
         chosenTransition = i;
 
     if (chosenTransition == -1)
-- 
GitLab