From bd0551c1d260dc4e27593a9e0de43952b4f50e3a Mon Sep 17 00:00:00 2001
From: Alex <alexandravigneron1@gmail.com>
Date: Wed, 8 Jul 2020 11:32:08 +0200
Subject: [PATCH] update handling messages delta

---
 .../solver/decentralized/mgm2/AgentBehaviour.scala  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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 30e0934..a094012 100755
--- a/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala
+++ b/src/main/scala/org/scadcop/solver/decentralized/mgm2/AgentBehaviour.scala
@@ -73,6 +73,11 @@ class AgentBehaviour(variable: Variable,
       stay using mind
     }
 
+    case Event(Reject(_), mind) => {
+      if (debug) println(s"$variable in $stateName has received Reject and ignores it")
+      stay using mind
+    }
+
     case Event(InformDelta(_), mind) => {
       if (debug) println(s"$variable in $stateName has received InformDelta and stashed it")
       stash
@@ -253,6 +258,12 @@ class AgentBehaviour(variable: Variable,
   */
   when(ReceiverWaitingValues) {
 
+    case Event(InformDelta(_), mind) => {
+      if (debug) println(s"$variable in $stateName has received InformDelta and stashes it")
+      stash
+      stay using mind
+    }
+
         // When it receives a reject it does NOTHING
     case Event(Reject(_), mind) =>
       if (debug) println(s"$variable in $stateName has received Reject and ignores it")
@@ -365,7 +376,7 @@ class AgentBehaviour(variable: Variable,
   when(Committed) {
 
     //when it receives its partner's giveGo
-    case Event(GiveGo, mind) => {
+    case Event(GiveGo(_), mind) => {
       if (debug) println(s"$variable in $stateName has received GiveGo and stashes it")
       stash
       stay using mind
-- 
GitLab