From 98c33deb363af8a7225c6b8dbcc1df3a47890fdb Mon Sep 17 00:00:00 2001
From: Maxime MORGE <maxime.morge@univ-lille1.fr>
Date: Thu, 2 Jul 2020 11:49:55 +0200
Subject: [PATCH] Minor correction

---
 .../solver/decentralized/mgm2/AgentBehaviour.scala     | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala b/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala
index bb2b710..d0d48ff 100644
--- a/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala
+++ b/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala
@@ -389,13 +389,9 @@ class AgentBehaviour(variable: Variable,
       val neighbour: Variable = directory.variableOf(sender)
       val updatedMind: MGM2Mind = mind.updateDeltas(neighbour: Variable, delta: Double)
       val shouldIact: Boolean = updatedMind.amIBest(variable)
-      val (bestUnilateralMove, gain): (Option[UnilateralMove], Double) = updatedMind.bestUnilateralMove(variable, constraints)
-      val bestMove : UnilateralMove = bestUnilateralMove match {
-        case Some(m) => m
-        case None => new UnilateralMove(new Context(), 0.0) //TODO change for option(move)
-      }
+      val bestUnilateralMove = updatedMind.bestUnilateralMove(variable, constraints)._1
       if (trace) println(s"$variable -> $variable : Act($shouldIact)")
-      self ! Act(shouldIact, Some(bestMove))
+      self ! Act(shouldIact, bestUnilateralMove)
       unstashAll
       goto(ActSolo) using updatedMind
   }
@@ -449,7 +445,7 @@ class AgentBehaviour(variable: Variable,
          case Some(p) => p
          case None => throw new RuntimeException(s"Error $variable is committed but lacks a partner in state $stateName")
        }
-      if (trace) println(s"$variable -> ${directory.addressOf(partner)} : GiveGo($move)")
+      if (trace) println(s"$variable -> ${partner} : GiveGo($move)")
       directory.addressOf(partner) ! GiveGo(move)
       goto(HandlingPartnersGoNogo) using mind
 
-- 
GitLab