Skip to content
Snippets Groups Projects
Commit 2f5f28b0 authored by markn92's avatar markn92
Browse files

wip

parent e0039f48
No related branches found
No related tags found
1 merge request!1Working np Algorithm
......@@ -12,6 +12,19 @@ Label = namedtuple('Label', ['t_trip', 'beta_u', 'u', 'SoCProfile_u_v'])
class ChargingFunction:
def __init__(self, G: nx.Graph, n: Node, U: SoC):
self.c_n = charging_cofficient(G, n)
self.U = U
def __call__(self, t: Time, beta: SoC = 0) -> SoC:
beta += self.c_n * t
if beta > self.U:
return self.U
class SoCFunction:
def __init__(self, G: nx.Graph, l: Label):
self.t_trip: Time = l.t_trip
self.beta_u: SoC = l.beta_u
......
......@@ -25,7 +25,7 @@ def shortest_path(G: nx.Graph, S: set, s: Node, t: Node, beta_s: SoC, beta_t: So
l_uns = {v: PriorityQueue() for v in G}
# Dummy vertex without incident edges that is (temporarily) added to G
v_0: Node = Node(len(G.nodes))
v_0: Node = len(G.nodes)
G.add_node(v_0)
S.add(v_0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment