From 8e453ed54ebcd9413afece84f7b1c67b616ab901 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 12 Jun 2022 08:57:59 +0200 Subject: [PATCH] Update comments --- esds.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esds.py b/esds.py index 408f4da..ad08909 100644 --- a/esds.py +++ b/esds.py @@ -196,6 +196,11 @@ class Simulator: def __init__(self,netmat): """ Format of netmat: { "interface": {"bandwidth": matrix, "latency": matrix, "is_wired":bool}} + For wireless interfaces the diagonal of the bandwidth and latency matrix are very important. + It determines the duration of the tranmission for THE SENDER. Thus, at each wireless communication, + and addionnal event is created for the sender that corresponds to a send to himself (diagonal of the matrices) used + to unlock him from the api.send() call. Consequently, duration of the transmission can be + different from the time at which the receivers actually receive the data (non-diagonal entries of the matrices). """ self.netmat=netmat self.nodes=list() @@ -471,6 +476,8 @@ class Simulator: if self.nodes[dst]["turned_on"]: duration=datasize*8/self.netmat[interface]["bandwidth"][src,dst]+self.netmat[interface]["latency"][src,dst] if src == dst: + # This event (where src == dst) is used to notify the sender when data is received! + # Correspond to the diagonal of the network matrices (bandwidth and latency) self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time)) elif not self.interferences: self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time))