Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ags_grabber
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
Bryson Howell
ags_grabber
Commits
84161f94
Commit
84161f94
authored
Sep 17, 2024
by
Bryson Howell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small change to work with new pythonlpm repo
parent
25b4fb66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
lpm_hikersim.py
lpm_hikersim.py
+14
-5
No files found.
lpm_hikersim.py
View file @
84161f94
...
@@ -3,6 +3,7 @@ import matplotlib
...
@@ -3,6 +3,7 @@ import matplotlib
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
import
os
,
sys
,
inspect
import
os
,
sys
,
inspect
from
os
import
path
,
getcwd
from
os
import
path
,
getcwd
from
scipy.io
import
savemat
import
pandas
as
pd
import
pandas
as
pd
import
time
import
time
...
@@ -12,7 +13,7 @@ parentdir = os.path.dirname(currentdir)
...
@@ -12,7 +13,7 @@ parentdir = os.path.dirname(currentdir)
sys
.
path
.
insert
(
0
,
parentdir
)
sys
.
path
.
insert
(
0
,
parentdir
)
from
arcgis_terrain
import
get_terrain_map
,
lat_lon2meters
from
arcgis_terrain
import
get_terrain_map
,
lat_lon2meters
from
LostPersonModel.main_hiker
import
run_replicate
#change this import to where you have the LPM repo
from
pythonlpm.main_hiker
import
run_replicate
,
replicates
#change this import to where you have the LPM repo
#Runs replicates of lost person model on data sets collected by lpm_maps.py, producing a heatmap
#Runs replicates of lost person model on data sets collected by lpm_maps.py, producing a heatmap
...
@@ -21,11 +22,10 @@ from LostPersonModel.main_hiker import run_replicate #change this import to wh
...
@@ -21,11 +22,10 @@ from LostPersonModel.main_hiker import run_replicate #change this import to wh
def
main
(
exp_name
=
'test'
,
start_idx
=
0
,
n_envs
=
1
,
n_iter
=
10
):
def
main
(
exp_name
=
'test'
,
start_idx
=
0
,
n_envs
=
1
,
n_iter
=
10
):
#Size in meters of GIS datasets
#Size in meters of GIS datasets
test_extent
=
20000
test_extent
=
20000
download_extent
=
40000
download_extent
=
40000
LL
=
[
20000
,
20000
,
1
]
LL
=
[
20000
,
20000
,
3000
]
#LPM Parameters
#LPM Parameters
ts
=
850
#walking speed
ts
=
850
#walking speed
...
@@ -99,7 +99,12 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
...
@@ -99,7 +99,12 @@ def main(exp_name='test', start_idx=0, n_envs=1, n_iter=10):
#Run LPM
#Run LPM
#plot_env(map_data,ipp_xy,find_xy,exp_name,env,incident)
#plot_env(map_data,ipp_xy,find_xy,exp_name,env,incident)
start_t
=
time
.
time
()
start_t
=
time
.
time
()
[
x
,
y
,
behavior
]
=
run_replicate
(
ipp_xy
,
find_xy
,
map_data
,
T
,
p_behavior
,
alpha
,
LL
)
#test runs
#test(ipp_xy, find_xy, map_data, T, p_behavior, alpha, LL)
#return
#run real thing
replicates
(
ipp_xy
,
find_xy
,
map_data
,
T
,
p_behavior
,
alpha
,
LL
,
exp_name
)
end_t
=
time
.
time
()
end_t
=
time
.
time
()
end_t
=
end_t
-
start_t
end_t
=
end_t
-
start_t
print
(
'Lost Person Simulation finished, it took
%.2
f seconds'
%
end_t
)
print
(
'Lost Person Simulation finished, it took
%.2
f seconds'
%
end_t
)
...
@@ -179,6 +184,10 @@ def lf_format(inac, lf, elev):
...
@@ -179,6 +184,10 @@ def lf_format(inac, lf, elev):
print
(
"We have
%
d linear features and
%
d inacessible areas, it took
%.1
f seconds"
%
(
lf_ct
,
inac_ct
,
end_t
))
print
(
"We have
%
d linear features and
%
d inacessible areas, it took
%.1
f seconds"
%
(
lf_ct
,
inac_ct
,
end_t
))
map_data
=
(
bw_inac
,
bw_lf
,
elev
)
map_data
=
(
bw_inac
,
bw_lf
,
elev
)
#Create Matlab version of the map data
mdic
=
{
"bw_inac"
:
bw_inac
,
"bw_lf"
:
bw_lf
,
"elev"
:
elev
}
savemat
(
'./map_layers/trust/trust_0/map_data.m'
,
mdic
)
return
map_data
return
map_data
#Creates a plot of the environment from saved data
#Creates a plot of the environment from saved data
...
@@ -357,7 +366,7 @@ def test_lf_format(exp_name='test',force_save='False'):
...
@@ -357,7 +366,7 @@ def test_lf_format(exp_name='test',force_save='False'):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
start
=
7
#Environment to start at (0 is first, 8 is first large map)
start
=
0
#Environment to start at (0 is first, 8 is first large map)
n
=
1
#Number of environments to test
n
=
1
#Number of environments to test
mc
=
10
#Monte Carlo iterations
mc
=
10
#Monte Carlo iterations
...
...
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