You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #!/usr/bin/python3
  2. import os
  3. import subprocess
  4. abs_path = os.getcwd()
  5. slippery_configs=[f"{abs_path}/slippery_prob_075.yaml",
  6. # f"{abs_path}/slippery_prob_08.yaml",
  7. f"{abs_path}/slippery_prob_085.yaml",
  8. # f"{abs_path}/slippery_prob_09.yaml",
  9. f"{abs_path}/slippery_prob_095.yaml",
  10. # f"{abs_path}/slippery_prob_1.yaml"
  11. ]
  12. slippery_probs=[[0.125, 0.25, 0.75], # 0.75
  13. #[0.1, 0.2, 0.8], # 0.8
  14. [0.075,0.15,0.85], # 0.85
  15. #[0.05, 0.1, 0.9], # 0.9
  16. [0.025,0.05, 0.95], # 0.95
  17. # [0.01, 0.02, 0.98], # 0.98
  18. # [0.005,0.01, 0.99], # 0.99
  19. #[0, 0, 1] # 1
  20. ]
  21. #shield_values = [0.85, 0.9, 0.95, 0.98, 0.99, 1]
  22. shield_values = [0.85, .95, 1]
  23. prob_confs = list(zip(slippery_probs, slippery_configs))
  24. counter = 1
  25. shielding = ["full", "none"]
  26. comparison_type = ["relative", "absolute"]
  27. comps = ["relative", "absolute"]
  28. NUM_TIMESTEPS=250000
  29. LOGDIR="../logresults/"
  30. ENV="MiniGrid-LavaSlipperyS12-v2"
  31. # matrix for shielded runs
  32. for shield_value in shield_values:
  33. for sh_comp in comparison_type:
  34. for probs, config in prob_confs:
  35. command = f"echo \"Running experiment with shielding full, sh_value:{probs[2]}, sh_comp:{sh_comp}, probvalues:{probs}, config{config}\""
  36. execute_command = f'./syncscript.sh {NUM_TIMESTEPS} {LOGDIR} {"70"} {ENV} full {sh_comp} {config} {probs[0]} {probs[1]} {probs[2]} {shield_value}'
  37. subprocess.call(execute_command, shell=True)#.decode("utf-8").split('\n')
  38. # loop for unshielded runs
  39. for probs, config in prob_confs:
  40. command = f"echo \"Running experiment with shielding none, sh_value:{probs[2]}, sh_comp:{sh_comp}, probvalues:{probs}, config{config}\""
  41. execute_command = f'./syncscript.sh {NUM_TIMESTEPS} {LOGDIR} {"70"} {ENV} none {sh_comp} {config} {probs[0]} {probs[1]} {probs[2]} {shield_value}'
  42. subprocess.call(execute_command, shell=True)#.decode("utf-8").split('\n')