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
6ca9aa6c
Commit
6ca9aa6c
authored
4 years ago
by
markn92
Browse files
Options
Downloads
Patches
Plain Diff
minor
parent
1b819739
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
evrouting/charge/routing.py
+1
-1
1 addition, 1 deletion
evrouting/charge/routing.py
evrouting/gasstation/routing.py
+4
-4
4 additions, 4 deletions
evrouting/gasstation/routing.py
with
5 additions
and
5 deletions
evrouting/charge/routing.py
+
1
−
1
View file @
6ca9aa6c
...
@@ -7,7 +7,7 @@ Implementation of the CHArge algorithm [0] with two further constraints:
...
@@ -7,7 +7,7 @@ Implementation of the CHArge algorithm [0] with two further constraints:
[0] https://dl.acm.org/doi/10.1145/2820783.2820826
[0] https://dl.acm.org/doi/10.1145/2820783.2820826
"""
"""
from
typing
import
Dict
,
List
,
Tuple
,
Set
,
Union
from
typing
import
Dict
,
List
,
Tuple
,
Set
from
math
import
inf
from
math
import
inf
import
networkx
as
nx
import
networkx
as
nx
...
...
This diff is collapsed.
Click to expand it.
evrouting/gasstation/routing.py
+
4
−
4
View file @
6ca9aa6c
from
typing
import
Set
,
List
,
Tuple
from
typing
import
Set
,
List
import
networkx
as
nx
import
networkx
as
nx
from
evrouting.T
import
Node
,
SoC
,
Result
,
EmptyResult
,
Time
from
evrouting.T
import
Node
,
SoC
,
Result
,
EmptyResult
,
Time
...
@@ -106,12 +106,12 @@ def contract_graph(G: nx.Graph, charging_stations: Set[Node], capacity: SoC,
...
@@ -106,12 +106,12 @@ def contract_graph(G: nx.Graph, charging_stations: Set[Node], capacity: SoC,
# Iterate unvisited charging stations
# Iterate unvisited charging stations
for
n_cs
in
[
n
for
n
in
charging_stations
if
(
n
,
cs
)
not
in
H
.
edges
and
n
!=
cs
]:
for
n_cs
in
[
n
for
n
in
charging_stations
if
(
n
,
cs
)
not
in
H
.
edges
and
n
!=
cs
]:
min_path
:
List
[
Node
]
=
dist
(
G
,
cs
,
n_cs
)
min_path
:
List
[
Node
]
=
dist
(
G
,
cs
,
n_cs
)
consumptio
n
:
SoC
=
fold_path
(
G
,
min_path
,
weight
=
CONSUMPTION_KEY
)
w_cs_
n
:
SoC
=
fold_path
(
G
,
min_path
,
weight
=
CONSUMPTION_KEY
)
if
consumptio
n
<=
capacity
:
if
w_cs_
n
<=
capacity
:
H
.
add_edge
(
H
.
add_edge
(
cs
,
n_cs
,
cs
,
n_cs
,
**
{
**
{
CONSUMPTION_KEY
:
consumptio
n
,
CONSUMPTION_KEY
:
w_cs_
n
,
DISTANCE_KEY
:
fold_path
(
G
,
min_path
,
weight
=
DISTANCE_KEY
)
DISTANCE_KEY
:
fold_path
(
G
,
min_path
,
weight
=
DISTANCE_KEY
)
}
}
)
)
...
...
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