mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-26 15:13:57 +00:00
Init ESDS repository
This commit is contained in:
commit
c2e6aad09f
106 changed files with 2638 additions and 0 deletions
11
tests/simple_read_wlan0_ncom_2s1r/out
Normal file
11
tests/simple_read_wlan0_ncom_2s1r/out
Normal 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
|
12
tests/simple_read_wlan0_ncom_2s1r/receiver.py
Normal file
12
tests/simple_read_wlan0_ncom_2s1r/receiver.py
Normal 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
|
9
tests/simple_read_wlan0_ncom_2s1r/sender.py
Normal file
9
tests/simple_read_wlan0_ncom_2s1r/sender.py
Normal 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)
|
17
tests/simple_read_wlan0_ncom_2s1r/simulator.py
Executable file
17
tests/simple_read_wlan0_ncom_2s1r/simulator.py
Executable 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)
|
Loading…
Add table
Add a link
Reference in a new issue