Commit 2e42fa8c authored by Larkin Heintzman's avatar Larkin Heintzman

added simple run controls

parent 179fbe0a
...@@ -169,16 +169,34 @@ def main(iteration = 0, parameters = -1): ...@@ -169,16 +169,34 @@ def main(iteration = 0, parameters = -1):
if __name__ == "__main__": if __name__ == "__main__":
kentland_heatmap = 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\kentland_hiker\\ic_2_con_hiker_t8.csv' params = ({
hmpark_heatmap = 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\hmpark_hiker\\ic_2_con_hiker_t8.csv' 'save_folder': 'hmpark_n{}_s{}_rc'.format(n, s),
# self.params.setdefault('lp_filename', 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\kentland_hiker\\ic_2_con_hiker_t8.csv') 'lp_model': 'custom',
# self.params.setdefault('lin_feat_filename', 'C:\\Users\\Larkin\\ags_grabber\\matlab_data_locale\\BW_LFandInac_Zelev_kentland.mat') 'opt_iterations': 1,
n_max = 6 'path_style': 'rc',
s_max = 2 'stats_name': 'hmpark',
global_fail_max = 1000 'anchor_point': [36.891640, -81.524214], # hmpark
global_fails = 0 'num_searchers': s,
avg_runs = 5 'num_robots': n,
start_time = time.time() 'lp_filename': hmpark_heatmap,
'plot_data': True, # plots data in plotly viewer upon finishing
'save_data': False # saves risk-cost and waypoint related data in json upon finishing
})
params = Default(params).params
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
main(iteration=0, parameters=params)
# kentland_heatmap = 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\kentland_hiker\\ic_2_con_hiker_t8.csv'
# hmpark_heatmap = 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\hmpark_hiker\\ic_2_con_hiker_t8.csv'
# # self.params.setdefault('lp_filename', 'C:\\Users\\Larkin\\planning_llh_bgc\\LP model\\analysis\\outputs\\kentland_hiker\\ic_2_con_hiker_t8.csv')
# # self.params.setdefault('lin_feat_filename', 'C:\\Users\\Larkin\\ags_grabber\\matlab_data_locale\\BW_LFandInac_Zelev_kentland.mat')
# n_max = 6
# s_max = 2
# global_fail_max = 1000
# global_fails = 0
# avg_runs = 5
# start_time = time.time()
# for n in range(1, n_max + 1): # for n in range(1, n_max + 1):
# for s in range(2,s_max + 1): # for s in range(2,s_max + 1):
...@@ -344,85 +362,85 @@ if __name__ == "__main__": ...@@ -344,85 +362,85 @@ if __name__ == "__main__":
# global_fails += 1 # global_fails += 1
# #
# # ----------------------------------------------------------------------------------------------- # # -----------------------------------------------------------------------------------------------
#
for n in range(5, n_max + 1): # for n in range(5, n_max + 1):
for s in range(2, s_max + 1): # for s in range(2, s_max + 1):
params = ({ # params = ({
'save_folder': 'hmpark_n{}_s{}_unopt'.format(n, s), # 'save_folder': 'hmpark_n{}_s{}_unopt'.format(n, s),
'lp_model': 'custom', # 'lp_model': 'custom',
'opt_iterations': 3, # 'opt_iterations': 3,
'path_style': 'basic', # 'path_style': 'basic',
'stats_name': 'hmpark', # 'stats_name': 'hmpark',
'anchor_point': [36.891640, -81.524214], # hmpark # 'anchor_point': [36.891640, -81.524214], # hmpark
'num_searchers': s, # 'num_searchers': s,
'num_robots': n, # 'num_robots': n,
'lp_filename': hmpark_heatmap # 'lp_filename': hmpark_heatmap
}) # })
params = Default(params).params # params = Default(params).params
#
counter = 0 # counter = 0
while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs # while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs
torch.cuda.empty_cache() # torch.cuda.empty_cache()
torch.cuda.ipc_collect() # torch.cuda.ipc_collect()
try: # try:
main(iteration=counter, parameters=params) # main(iteration=counter, parameters=params)
counter += 1 # counter += 1
except AttributeError as e: # except AttributeError as e:
print("\n\n ------- bad optimization, re trying ---------- \n") # print("\n\n ------- bad optimization, re trying ---------- \n")
global_fails += 1 # global_fails += 1
#
# ----------------------------------------------------------------------------------------------- # # -----------------------------------------------------------------------------------------------
#
for n in range(1, n_max + 1): # for n in range(1, n_max + 1):
for s in range(2, s_max + 1): # for s in range(2, s_max + 1):
params = ({ # params = ({
'save_folder': 'hmpark_n{}_s{}_sweep'.format(n, s), # 'save_folder': 'hmpark_n{}_s{}_sweep'.format(n, s),
'lp_model': 'custom', # 'lp_model': 'custom',
'opt_iterations': 1, # 'opt_iterations': 1,
'path_style': 'sweep', # 'path_style': 'sweep',
'stats_name': 'hmpark', # 'stats_name': 'hmpark',
'anchor_point': [36.891640, -81.524214], # hmpark # 'anchor_point': [36.891640, -81.524214], # hmpark
'num_searchers': s, # 'num_searchers': s,
'num_robots': n, # 'num_robots': n,
'lp_filename': hmpark_heatmap # 'lp_filename': hmpark_heatmap
}) # })
params = Default(params).params # params = Default(params).params
#
counter = 0 # counter = 0
while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs # while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs
torch.cuda.empty_cache() # torch.cuda.empty_cache()
torch.cuda.ipc_collect() # torch.cuda.ipc_collect()
try: # try:
main(iteration=counter, parameters=params) # main(iteration=counter, parameters=params)
counter += 1 # counter += 1
except AttributeError as e: # except AttributeError as e:
print("\n\n ------- bad optimization, re trying ---------- \n") # print("\n\n ------- bad optimization, re trying ---------- \n")
global_fails += 1 # global_fails += 1
#
# ----------------------------------------------------------------------------------------------- # # -----------------------------------------------------------------------------------------------
#
for n in range(1, n_max + 1): # for n in range(1, n_max + 1):
for s in range(2, s_max + 1): # for s in range(2, s_max + 1):
params = ({ # params = ({
'save_folder': 'hmpark_n{}_s{}_rc'.format(n, s), # 'save_folder': 'hmpark_n{}_s{}_rc'.format(n, s),
'lp_model': 'custom', # 'lp_model': 'custom',
'opt_iterations': 1, # 'opt_iterations': 1,
'path_style': 'rc', # 'path_style': 'rc',
'stats_name': 'hmpark', # 'stats_name': 'hmpark',
'anchor_point': [36.891640, -81.524214], # hmpark # 'anchor_point': [36.891640, -81.524214], # hmpark
'num_searchers': s, # 'num_searchers': s,
'num_robots': n, # 'num_robots': n,
'lp_filename': hmpark_heatmap # 'lp_filename': hmpark_heatmap
}) # })
params = Default(params).params # params = Default(params).params
#
counter = 0 # counter = 0
while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs # while counter < avg_runs and global_fails <= global_fail_max: # number of averaging runs
torch.cuda.empty_cache() # torch.cuda.empty_cache()
torch.cuda.ipc_collect() # torch.cuda.ipc_collect()
try: # try:
main(iteration=counter, parameters=params) # main(iteration=counter, parameters=params)
counter += 1 # counter += 1
except AttributeError as e: # except AttributeError as e:
print("\n\n ------- bad optimization, re trying ---------- \n") # print("\n\n ------- bad optimization, re trying ---------- \n")
global_fails += 1 # global_fails += 1
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment