Skip to content
Snippets Groups Projects
Commit 4b0bad44 authored by Maxime MORGE's avatar Maxime MORGE
Browse files

Compliant with the "Teoz" architecture of plantuml for nice print of broadcast

parent 73ae123d
No related branches found
No related tags found
No related merge requests found
...@@ -34,10 +34,17 @@ abstract class VariableAgent(val variable: Variable, ...@@ -34,10 +34,17 @@ abstract class VariableAgent(val variable: Variable,
* Multicast a message to some peers * Multicast a message to some peers
*/ */
def multicast(peers : Set[Variable], message : Message): Unit = { def multicast(peers : Set[Variable], message : Message): Unit = {
var isFirst = true
var log = ""
peers.foreach { other => 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 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