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
b41cee15
Commit
b41cee15
authored
5 years ago
by
markn92
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
2f5f28b0
No related branches found
No related tags found
1 merge request
!1
Working np Algorithm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
evrouting/charge/T.py
+3
-3
3 additions, 3 deletions
evrouting/charge/T.py
evrouting/charge/routing.py
+2
-2
2 additions, 2 deletions
evrouting/charge/routing.py
with
5 additions
and
5 deletions
evrouting/charge/T.py
+
3
−
3
View file @
b41cee15
...
...
@@ -25,18 +25,18 @@ class ChargingFunction:
class
SoCFunction
:
def
__init__
(
self
,
G
:
nx
.
Graph
,
l
:
Label
):
def
__init__
(
self
,
G
:
nx
.
Graph
,
l
:
Label
,
U
:
SoC
):
self
.
t_trip
:
Time
=
l
.
t_trip
self
.
beta_u
:
SoC
=
l
.
beta_u
self
.
u
:
Node
=
l
.
u
self
.
b_u_v
:
SoCProfile
=
l
.
SoCProfile_u_v
self
.
c
_u
:
Charging
Coefficient
=
c
harging
_cofficient
(
G
,
l
.
u
)
self
.
c
f
:
Charging
Function
=
C
harging
Function
(
G
,
l
.
u
,
U
)
def
__call__
(
self
,
t
)
->
SoC
:
if
t
<
self
.
t_trip
:
return
-
inf
return
self
.
b
eta
_u
(
self
.
beta_u
+
self
.
c_u
*
(
t
-
self
.
t_trip
))
return
self
.
b_u
_v
(
self
.
cf
(
t
-
self
.
t_trip
,
self
.
beta_u
))
def
get_minimum
(
self
)
->
Time
:
"""
TODO: Explain.
"""
...
...
This diff is collapsed.
Click to expand it.
evrouting/charge/routing.py
+
2
−
2
View file @
b41cee15
...
...
@@ -5,7 +5,7 @@ import networkx as nx
from
evrouting.T
import
Node
,
SoC
,
Time
,
ChargingCoefficient
from
evrouting.utils
import
PriorityQueue
from
.T
import
SoCProfile
,
Charging
Function
,
Label
from
.T
import
SoCProfile
,
SoC
Function
,
Label
def
shortest_path
(
G
:
nx
.
Graph
,
S
:
set
,
s
:
Node
,
t
:
Node
,
beta_s
:
SoC
,
beta_t
:
SoC
,
U
:
SoC
):
...
...
@@ -50,7 +50,7 @@ def shortest_path(G: nx.Graph, S: set, s: Node, t: Node, beta_s: SoC, beta_t: So
l_set
[
v
].
add
(
l
)
if
v
==
t
:
return
Charging
Function
(
G
,
l
).
get_minimum
()
return
SoC
Function
(
G
,
l
,
U
).
get_minimum
()
# handle charging stations
t_trip
,
beta_u
,
u
,
b_u_v
=
l
...
...
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