Skip to content
Snippets Groups Projects

pydtn agkmeans and version 1.0

Merged Hunter McConnell (rtm534) requested to merge summer2022 into develop
3 files
+ 197
165
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 13
5
@@ -43,11 +43,19 @@ def run_simulation(simulation):
if simulation.traffic_options["start"] < simulation.node_options["epoch"]:
simulation.traffic_options["start"] = simulation.node_options["epoch"] # otherwise get none type error when clustering
traffic = RandomTraffic(nodes, **simulation.traffic_options)
traffic = RandomTraffic(nodes, **ChainMap(simulation.traffic_options, {"seed":simulation.seed}))
network = Network(nodes, trace, traffic)
network.run()
# record packets stats
with open("_packets_.txt", "a", encoding="utf-8") as file:
file.write("__" + str(simulation.node_type) + "__\n")
for packet in network.stats["packets"]:
file.write("S" + str(packet["source"].name) + "\tD" + str(packet["destination"].name) +
"\ttrace: " + packet["traceroute"] + "\n")
stats = {
"trace": simulation.trace,
"node_type": simulation.node_type.__name__,
@@ -161,10 +169,10 @@ def create_sim_list(config):
)
# overwrite seeds with random ones for fatemeh testing
batch = config["SimOptions"]["batch"]
seeds = []
for _ in range(batch):
seeds.append(randint(0, 500))
# batch = config["SimOptions"]["batch"]
# seeds = []
# for _ in range(batch):
# seeds.append(randint(0, 500))
for seed in seeds:
for node_type in config["NodeChoices"]["Nodes"]:
Loading