mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Update comments
This commit is contained in:
parent
dd7d5863d3
commit
8e453ed54e
1 changed files with 7 additions and 0 deletions
7
esds.py
7
esds.py
|
@ -196,6 +196,11 @@ class Simulator:
|
||||||
def __init__(self,netmat):
|
def __init__(self,netmat):
|
||||||
"""
|
"""
|
||||||
Format of netmat: { "interface": {"bandwidth": matrix, "latency": matrix, "is_wired":bool}}
|
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.netmat=netmat
|
||||||
self.nodes=list()
|
self.nodes=list()
|
||||||
|
@ -471,6 +476,8 @@ class Simulator:
|
||||||
if self.nodes[dst]["turned_on"]:
|
if self.nodes[dst]["turned_on"]:
|
||||||
duration=datasize*8/self.netmat[interface]["bandwidth"][src,dst]+self.netmat[interface]["latency"][src,dst]
|
duration=datasize*8/self.netmat[interface]["bandwidth"][src,dst]+self.netmat[interface]["latency"][src,dst]
|
||||||
if 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))
|
self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time))
|
||||||
elif not self.interferences:
|
elif not self.interferences:
|
||||||
self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time))
|
self.add_event(0,duration+self.time,(src,dst,interface,data,datasize,duration,datasize,self.time))
|
||||||
|
|
Loading…
Add table
Reference in a new issue