diff options
| -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)) |
