Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBEC 2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léna Aix
EBEC 2021
Commits
2c67e991
Commit
2c67e991
authored
4 years ago
by
Alexandre Pradeilles
Browse files
Options
Downloads
Plain Diff
read me
parents
47da009d
84bb5d91
No related branches found
No related tags found
1 merge request
!1
Sansdocker
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
research.py
+1
-22
1 addition, 22 deletions
research.py
with
1 addition
and
22 deletions
research.py
+
1
−
22
View file @
2c67e991
from
request
import
requete_osm
from
math
import
sqrt
,
sin
,
cos
,
pi
from
concurrent.futures
import
ThreadPoolExecutor
import
time
def
circular_research
(
lat
,
lon
,
main_street
):
...
...
@@ -90,29 +89,11 @@ def check_position(lat, lon, step, main_street, i):
return
street
def
multi_position
(
lat
,
lon
,
step
):
#test de multrithreading mais cela n'améliore pas énormément la vitesse de calcul
#donc pas utilisé finalement
latitude
=
[]
longitude
=
[]
for
j
in
range
(
1
,
4
):
stp
=
j
*
step
for
i
in
range
(
8
):
latitude
.
append
(
lat
+
stp
*
cos
(
i
*
2
*
pi
/
8
))
longitude
.
append
(
lon
+
stp
*
sin
(
i
*
2
*
pi
/
8
))
with
ThreadPoolExecutor
(
max_workers
=
30
)
as
executor
:
streets
=
executor
.
map
(
requete_osm
,
latitude
,
longitude
)
executor
.
shutdown
(
wait
=
True
)
return
streets
if
__name__
==
"
__main__
"
:
lat
=
48.89494122
lon
=
2.247959188
step
=
10
**
(
-
5
)
main_street
=
'
Avenue Gambetta
'
t1
=
time
.
time
()
streets
=
multi_position
(
48.89494122
,
2.247959188
,
10
**
(
-
5
))
t2
=
time
.
time
()
#print(len(list(streets)))
print
(
t2
-
t1
)
t1
=
time
.
time
()
...
...
@@ -122,5 +103,3 @@ if __name__=="__main__":
check_position
(
lat
,
lon
,
stp
,
main_street
,
i
)
t2
=
time
.
time
()
print
(
t2
-
t1
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment