Commit 492260c0 authored by Jarrod Pas's avatar Jarrod Pas
Browse files

Add shed1 hcbf example

parent b55d1833
from os import path
from pydtn import Network, csv_trace, random_traffic
from pydtn.community import HCBFNode, LouvainCommunity
def main():
shed1 = path.join('shed', 'data', 'pp_shed1_reduced.csv')
nodes = 39
seed = 42
epoch = 7*24*60*60 # 7 days
traffic_speed = 30 * 60 # 1 packet every 30 mins
node_options = {
'tick_rate': 5 * 60, # 5 mins,
'community': LouvainCommunity(epoch),
}
nodes = {
node_id: HCBFNode(**node_options)
for node_id in range(nodes)
}
trace = csv_trace(shed1)
traffic = random_traffic(nodes, start=epoch,
speed=traffic_speed,
seed=seed)
network = Network(nodes, traffic=traffic, trace=trace)
network.run()
print(network.stats)
if __name__ == '__main__':
exit(main())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment