mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-07 02:26:28 +02:00
Improve comments
This commit is contained in:
parent
8e453ed54e
commit
f165afac6e
2 changed files with 10 additions and 6 deletions
10
esds.py
10
esds.py
|
@ -195,11 +195,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": numpy_matrix, "latency": numpy_matrix, "is_wired":bool}}
|
||||||
For wireless interfaces the diagonal of the bandwidth and latency matrix are very important.
|
For wireless interfaces the diagonals of the bandwidth and latency matrices are very important.
|
||||||
It determines the duration of the tranmission for THE SENDER. Thus, at each wireless communication,
|
They determine the duration of the tranmission for THE SENDER. It allows to have a different tx duration per node and per interface.
|
||||||
and addionnal event is created for the sender that corresponds to a send to himself (diagonal of the matrices) used
|
Thus, at each wireless communication, an addionnal event is created for the sender that corresponds to a send to himself (diagonals of the matrices) used
|
||||||
to unlock him from the api.send() call. Consequently, duration of the transmission can be
|
to unlock him from the api.send() call. Consequently, the duration of the transmission (by the sender) can be
|
||||||
different from the time at which the receivers actually receive the data (non-diagonal entries of the matrices).
|
different from the time at which the receivers actually receive the data (non-diagonal entries of the matrices).
|
||||||
"""
|
"""
|
||||||
self.netmat=netmat
|
self.netmat=netmat
|
||||||
|
|
|
@ -16,7 +16,9 @@ import numpy as np
|
||||||
|
|
||||||
##### Bandwidth matrix
|
##### Bandwidth matrix
|
||||||
# Bandwidth value can be 0 for unreachable nodes
|
# Bandwidth value can be 0 for unreachable nodes
|
||||||
# Diagonal entries impact the transmission duration for wireless transmissions (wlan0)
|
# Regarding wireless interfaces the diagonals of the bandwidth and latency matrices are very important.
|
||||||
|
# They determine the duration of the tranmission for THE SENDER. It allows to have a different tx
|
||||||
|
# duration per node and per interface. Please cf esds.py for more informations.
|
||||||
n=2 # Number of nodes including the sender
|
n=2 # Number of nodes including the sender
|
||||||
B=np.full((n,n),5) # 5Mbps
|
B=np.full((n,n),5) # 5Mbps
|
||||||
|
|
||||||
|
@ -26,6 +28,8 @@ B=np.full((n,n),5) # 5Mbps
|
||||||
L=np.full((n,n),0) # 0s
|
L=np.full((n,n),0) # 0s
|
||||||
|
|
||||||
##### Create the simulator
|
##### Create the simulator
|
||||||
|
# esds.Simulator take at least a dictionnary as a parameter
|
||||||
|
# This dictionnary contains all the network interfaces (name as a key) of each node
|
||||||
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False},"eth0":{"bandwidth":B, "latency":L, "is_wired":True}})
|
s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False},"eth0":{"bandwidth":B, "latency":L, "is_wired":True}})
|
||||||
|
|
||||||
##### Instantiate nodes
|
##### Instantiate nodes
|
||||||
|
|
Loading…
Add table
Reference in a new issue