Skip to content
Snippets Groups Projects
Commit 6e6e8b4f authored by Alex's avatar Alex
Browse files
parents 33865043 4b0bad44
Branches
No related tags found
No related merge requests found
......@@ -34,10 +34,17 @@ abstract class VariableAgent(val variable: Variable,
* Multicast a message to some peers
*/
def multicast(peers : Set[Variable], message : Message): Unit = {
var isFirst = true
var log = ""
peers.foreach { other =>
if (trace) println(s"$variable-> $other : $message")
if (trace){
if (isFirst) log += s"$variable-> $other : $message\n"
else log += s"& $variable -> $other :\n"
}
isFirst = false
directory.addressOf(other) ! message
}
if (trace) print(log)
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment