Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
planning_llh_bgc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
planning_llh_bgc
Commits
2e42fa8c
Commit
2e42fa8c
authored
Oct 21, 2020
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added simple run controls
parent
179fbe0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
92 deletions
+110
-92
test_robotgp.py
test_robotgp.py
+110
-92
No files found.
test_robotgp.py
View file @
2e42fa8c
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment