diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-06-12 08:57:59 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-06-12 08:57:59 +0200 |
| commit | 8e453ed54ebcd9413afece84f7b1c67b616ab901 (patch) | |
| tree | 6b23c27b3afc4f7791ab020a1ed63d76db193409 | |
| parent | dd7d5863d32477ddcfdfc08bb47626cddcc75a48 (diff) | |
Update comments
| -rw-r--r-- | esds.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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)) |
