Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ba
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
markn92
ba
Commits
61d226f9
"...fucoin/actions/transaction/ActionGetAmountAnswer.java" did not exist on "40b677aa4b857c7490277352bcc5c33cc57a9f34"
Commit
61d226f9
authored
4 years ago
by
markn92
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
6c7725ab
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data.py
+8
-3
8 additions, 3 deletions
data.py
evrouting/gasstation/routing.py
+3
-0
3 additions, 0 deletions
evrouting/gasstation/routing.py
evrouting/osm/imports.py
+7
-3
7 additions, 3 deletions
evrouting/osm/imports.py
evrouting/osm/routing.py
+9
-2
9 additions, 2 deletions
evrouting/osm/routing.py
with
27 additions
and
8 deletions
data.py
+
8
−
3
View file @
61d226f9
...
...
@@ -76,15 +76,20 @@ if __name__ == '__main__':
type
=
float
,
nargs
=
4
,
metavar
=
(
'
lat_nw
'
,
'
lon_nw
'
,
'
lat_se
'
,
'
lon_se
'
),
default
=
[
None
,
None
,
None
,
None
],
help
=
'
Use only those charging stations that are located with in a
'
'
rectangle defined by the north-west and south-east coordinates.
'
)
args
=
parser
.
parse_args
()
nw_corner
=
None
se_corner
=
None
if
args
.
cut
:
nw_corner
=
args
.
cut
[:
2
]
se_corner
=
args
.
cut
[
2
:]
parse_charging_stations_csv
(
args
.
input_path
,
nw_corner
=
args
.
cut
[:
2
]
,
se_corner
=
args
.
cut
[
2
:]
nw_corner
=
nw_corner
,
se_corner
=
se_corner
).
to_json
(
args
.
dest_path
,
orient
=
'
records
'
)
This diff is collapsed.
Click to expand it.
evrouting/gasstation/routing.py
+
3
−
0
View file @
61d226f9
...
...
@@ -101,6 +101,9 @@ def contract_graph(G: nx.Graph, charging_stations: Set[Node], capacity: SoC,
"""
H
:
nx
.
Graph
=
nx
.
Graph
()
if
not
charging_stations
:
return
H
all_cs
=
list
(
charging_stations
)
for
i
in
range
(
len
(
all_cs
)
-
1
):
cs
=
all_cs
[
i
]
...
...
This diff is collapsed.
Click to expand it.
evrouting/osm/imports.py
+
7
−
3
View file @
61d226f9
...
...
@@ -39,13 +39,17 @@ def query_url(service, coordinates, osrm_config: OsrmConf):
def
insert_charging_stations
(
G
,
charging_stations
):
"""
Insert Charging Stations
"""
S
=
set
()
for
s
in
charging_stations
:
lon
=
s
[
'
lon
'
]
lat
=
s
[
'
lat
'
]
n
=
find_nearest
(
G
,
(
lat
,
lon
))
G
.
nodes
[
n
][
CHARGING_COEFFICIENT_KEY
]
=
s
[
'
power
'
]
n
=
find_nearest
(
G
,
(
lat
,
lon
),
distance_limit
=
500
)
if
n
:
G
.
nodes
[
n
][
CHARGING_COEFFICIENT_KEY
]
=
s
[
'
power
'
]
S
.
add
(
n
)
return
G
return
S
class
OsrmDistance
:
...
...
This diff is collapsed.
Click to expand it.
evrouting/osm/routing.py
+
9
−
2
View file @
61d226f9
...
...
@@ -30,7 +30,11 @@ def haversine_distance(lon1, lat1, lon2, lat2, unit_m=True):
return
c
*
r
def
find_nearest
(
G
,
v
:
point
):
def
find_nearest
(
G
,
v
:
point
,
distance_limit
=
None
):
"""
Find nearest point to location v within radius
of distance_limit.
"""
min_dist
=
None
closest_node
=
None
...
...
@@ -48,7 +52,10 @@ def find_nearest(G, v: point):
closest_node
=
n
min_dist
=
d
return
closest_node
if
distance_limit
:
return
closest_node
if
min_dist
<=
distance_limit
else
None
else
:
return
closest_node
def
shortest_path
(
G
,
s
:
point
,
t
:
point
,
profile
):
...
...
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