Skip to content

Commit

Permalink
[pylibs/case_studies] filename fixes in multi-run
Browse files Browse the repository at this point in the history
  • Loading branch information
EskoDijk committed Apr 18, 2024
1 parent 1238ad1 commit 11be7b7
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pylibs/case_studies/office_floor_multi_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
from otns.cli import OTNS
from otns.cli.errors import OTNSExitedError

NUM_RUNS = 1
MAX_SIM_TIME = 20*60
NUM_RUNS = 50
MAX_SIM_TIME = 1 #20*60


def build_topology(ns):
Expand All @@ -53,7 +53,8 @@ def test_ulimit():
exit(1)

def run_formation(run_id, sim_time):
print(f'run_formation: run_id = {run_id}')
run_id_str = f'{run_id:02d}'
print(f'run_formation: run_id = {run_id_str}')

ns = OTNS(otns_args=['-seed',str(2342+run_id)])
#ns.web('main')
Expand All @@ -65,10 +66,11 @@ def run_formation(run_id, sim_time):
ns.kpi_stop()
ns.web_display()

ns.kpi_save(f'office_runs/kpi_{run_id}.json')
shutil.copy('tmp/0_stats.csv', f'office_runs/stats_{run_id}.csv')
shutil.copy('current.pcap', f'office_runs/pcap_{run_id}.pcap')
ns.delete_all()
ns.kpi_save(f'office_runs/{run_id_str}.json')
ns.close()

shutil.copy('tmp/0_stats.csv', f'office_runs/{run_id_str}.csv')
shutil.copy('current.pcap', f'office_runs/{run_id_str}.pcap')

def main():
test_ulimit()
Expand Down

0 comments on commit 11be7b7

Please sign in to comment.