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 bb2b710465d98a927c5c9fd184c773b69bc95fe0..d0d48fff4260ca74eefa2113c382825c7845a678 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