From b19bda0f71d693eddcfa432dc7a3cf6f6f4a1bb4 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Tue, 2 Jan 2024 10:00:38 +0100 Subject: [PATCH] polished testall matrix script --- testall.py | 61 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/testall.py b/testall.py index 7a91900..e7eb591 100644 --- a/testall.py +++ b/testall.py @@ -1,35 +1,50 @@ #!/usr/bin/python3 -import subprocess -slippery_configs=["/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_075.yaml", - "/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_08.yaml", - "/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_085.yaml", - "/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_09.yaml", - "/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_095.yaml", - "/home/knolli/Documents/University/Thesis/tempest-py/slippery_prob_1.yaml"] +abs_path = "TODO" +import subprocess +slippery_configs=[f"{abs_path}/slippery_prob_075.yaml", + f"{abs_path}/slippery_prob_08.yaml", + f"{abs_path}/slippery_prob_085.yaml", + f"{abs_path}/slippery_prob_09.yaml", + f"{abs_path}/slippery_prob_095.yaml", + f"{abs_path}/slippery_prob_1.yaml"] slippery_probs=[[0.125, 0.25, 0.75], # 0.75 - [0.1, 0.2, 0.8], # 0.8 + #[0.1, 0.2, 0.8], # 0.8 [0.075,0.15,0.85], # 0.85 - [0.05, 0.1, 0.9], # 0.9 + #[0.05, 0.1, 0.9], # 0.9 [0.025,0.05, 0.95], # 0.95 # [0.01, 0.02, 0.98], # 0.98 # [0.005,0.01, 0.99], # 0.99 - [0, 0, 1]] # 1 + #[0, 0, 1] # 1 + ] + -shield_values = [0.85, 0.9, 0.95, 0.98, 0.99, 1] +#shield_values = [0.85, 0.9, 0.95, 0.98, 0.99, 1] +shield_values = [0.85, .95, 1] prob_confs = list(zip(slippery_probs, slippery_configs)) -counter=1 -shielding=["full", "none"] -comps= ["relative", "absolute"] - -for sh in shielding: - for shield_value in shield_values: - for sh_comp in ["relative", "absolute"]: - for probs, config in prob_confs: - command = f"echo \"Running experiment with sh:{sh}, sh_value:{probs[2]}, sh_comp:{sh_comp}, probvalues:{probs}, config{config}\"" - execute_command = f'./syncscript_local.sh {250000} {"../logresults/"} {"70"} {"MiniGrid-LavaSlipperyS12-v2"} {sh} {sh_comp} {config} {probs[0]} {probs[1]} {probs[2]} {shield_value}' - subprocess.call(execute_command, shell=True)#.decode("utf-8").split('\n') - \ No newline at end of file +counter = 1 +shielding = ["full", "none"] +comparison_type = ["relative", "absolute"] +comps = ["relative", "absolute"] + +NUM_TIMESTEPS=250000 +LOGDIR="../logresults/" +ENV="MiniGrid-LavaSlipperyS12-v2" + +# matrix for shielded runs +for shield_value in shield_values: + for sh_comp in comparison_type: + for probs, config in prob_confs: + command = f"echo \"Running experiment with sh:{sh}, sh_value:{probs[2]}, sh_comp:{sh_comp}, probvalues:{probs}, config{config}\"" + execute_command = f'./syncscript_local.sh {NUM_TIMESTEPS} {LOGDIR} {"70"} {ENV} full {sh_comp} {config} {probs[0]} {probs[1]} {probs[2]} {shield_value}' + subprocess.call(execute_command, shell=True)#.decode("utf-8").split('\n') + +# loop for unshielded runs +for probs, config in prob_confs: + command = f"echo \"Running experiment with sh:{sh}, sh_value:{probs[2]}, sh_comp:{sh_comp}, probvalues:{probs}, config{config}\"" + execute_command = f'./syncscript_local.sh {NUM_TIMESTEPS} {LOGDIR} {"70"} {ENV} none {sh_comp} {config} {probs[0]} {probs[1]} {probs[2]} {shield_value}' + subprocess.call(execute_command, shell=True)#.decode("utf-8").split('\n') +