From 11be7b7d5cf4db8ad7e0538ce3ae1b48210b54c9 Mon Sep 17 00:00:00 2001 From: Esko Dijk Date: Thu, 18 Apr 2024 13:28:07 +0200 Subject: [PATCH] [pylibs/case_studies] filename fixes in multi-run --- pylibs/case_studies/office_floor_multi_runs.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pylibs/case_studies/office_floor_multi_runs.py b/pylibs/case_studies/office_floor_multi_runs.py index cf27c46e..8c1687f7 100755 --- a/pylibs/case_studies/office_floor_multi_runs.py +++ b/pylibs/case_studies/office_floor_multi_runs.py @@ -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): @@ -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') @@ -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()