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.

52 lines
2.0 KiB

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