Execute greedy algorithm only once

This commit is contained in:
coolneng 2021-05-20 19:28:06 +02:00
parent 5cff3199c6
commit b8b1fe9368
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 4 additions and 6 deletions

View File

@ -59,19 +59,17 @@ def script_execution(filenames, greedy, local, iterations=3):
script = "src/main.py" script = "src/main.py"
for dataset in filenames: for dataset in filenames:
print(f"Running on dataset {dataset}") print(f"Running on dataset {dataset}")
greedy_list = [] greedy_cmd = run(
[executable, script, dataset, "greedy"], capture_output=True
).stdout.splitlines()
local_list = [] local_list = []
for _ in range(iterations): for _ in range(iterations):
greedy_cmd = run(
[executable, script, dataset, "greedy"], capture_output=True
).stdout.splitlines()
local_cmd = run( local_cmd = run(
[executable, script, dataset, "local"], capture_output=True [executable, script, dataset, "local"], capture_output=True
).stdout.splitlines() ).stdout.splitlines()
greedy_list.append(greedy_cmd)
local_list.append(local_cmd) local_list.append(local_cmd)
greedy, local = populate_dataframes( greedy, local = populate_dataframes(
greedy, local, greedy_list, local_list, dataset greedy, local, greedy_cmd, local_list, dataset
) )
return greedy, local return greedy, local