...
{% for mote in motes %}
{{ mote.x }}
{{ mote.y }}
{{ mote.z }}
{{ mote.id }}
{{ mote.mote_type }}
{% endfor %}
...
with open("simulation_file.csc") as f:
f.write(template.render(motes=[
{"x": 0, "y": 0, "z": 0, "id": 0, "mote_type": "router"},
{"x": 1, "y": 1, "z": 1, "id": 1, "mote_type": "server"}
]))
@host("grenoble")
def run(exp_id):
run_experiment(exp_id)
_handlers = [
_handle_udp_reception_log,
_handle_udp_sending_log,
...,
]
messages = set()
with open(pj(folder, "serial.log")) as serial_file:
for line in serial_file:
for handler in _handlers:
match = re.match(handler.regexp, line, re.MULTILINE)
if match:
message = handler(match, stats)
messages.add(message)
break
return messages
import pandas as pd
df = pd.read_csv("my_results.csv")
df[df.pkt_type == "udp"].count()
import pandas as pd
df = pd.read_csv("my_results.csv")
df[df.pkt_type == "udp"].count().plot(kind="bar")
install:
# Install all dependencies
- sudo apt-get install tshark
script:
- ipython nbconvert --to=python demo.ipynb
- python demo.py