Init ESDS repository

This commit is contained in:
Loic Guegan 2022-06-09 21:48:32 +02:00
commit c2e6aad09f
106 changed files with 2638 additions and 0 deletions

View file

@ -0,0 +1,11 @@
[t=0.000,src=n2] wlan0 is 0
[t=624.000,src=n2] wlan0 is 0
[t=1248.000,src=n0] Send 50 bytes on wlan0
[t=1249.000,src=n2] wlan0 is 1
[t=1249.000,src=n1] Send 50 bytes on wlan0
[t=1250.000,src=n2] wlan0 is 2
[t=1381.333,src=n1] Receive 50 bytes on wlan0
[t=1381.333,src=n2] Receive 50 bytes on wlan0
[t=1382.333,src=n0] Receive 50 bytes on wlan0
[t=1382.333,src=n2] Receive 50 bytes on wlan0
[t=1382.333,src=esds] Simulation ends

View file

@ -0,0 +1,12 @@
#!/usr/bin/env python
def execute(api):
api.log("wlan0 is {}".format(api.read("wlan0_ncom")))
api.wait(624)
api.log("wlan0 is {}".format(api.read("wlan0_ncom")))
api.wait(624)
# Now we are at 624*2=1248 (first sender start a communication)
api.wait(1) # Let the communication starts
api.log("wlan0 is {}".format(api.read("wlan0_ncom"))) # Should print 1
api.wait(1) # Second sender start a communication
api.log("wlan0 is {}".format(api.read("wlan0_ncom"))) # Should print 2

View file

@ -0,0 +1,9 @@
#!/usr/bin/env python
def execute(api):
api.wait(1248)
if api.node_id==0:
api.send("wlan0","hello",50,None)
else:
api.wait(1)
api.send("wlan0","hello",50,None)

View file

@ -0,0 +1,17 @@
#!/usr/bin/env python
# Load ESDS
import sys
sys.path.append("../../")
import esds
import numpy as np
B=np.full((3,3),3)
L=np.full((3,3),0)
s=esds.Simulator(B,L)
s.create_node("sender")
s.create_node("sender")
s.create_node("receiver")
s.run(interferences=False)