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

brroken wip

parent 8af22a8f
Branches
No related tags found
No related merge requests found
......@@ -8,8 +8,8 @@ from evrouting.graph_tools import (
DISTANCE_KEY,
consumption,
distance,
charging_cofficient,
)
from evrouting.graph_tools import sum_weights as fold_path
......@@ -20,7 +20,8 @@ def insert_start_node(s: Node,
graph_extended: nx.DiGraph,
capacity: SoC,
initial_soc: SoC,
c: float = 1.
c: float = 1.,
charging_coefficient=charging_cofficient
) -> nx.DiGraph:
"""Insert s into extended graph an create states and edges as necessary."""
graph_extended.add_node((s, initial_soc))
......@@ -63,6 +64,7 @@ def insert_final_node(t: Node,
capacity: SoC,
final_soc: SoC,
c: float = 1.
charging_cofficient=charging_cofficient
) -> nx.DiGraph:
"""Insert terminal node into extended graph an create states and edges as necessary."""
graph_extended.add_node((t, final_soc))
......
......@@ -69,3 +69,20 @@ def consumption_function_distance_factory(consumption: float) -> ConsumptionFunc
return G[u][v][CONSUMPTION_KEY]
return c
class AccessFunctions:
def __init__(self,
distance=distance,
consumption=consumption,
charging_coefficient=charging_cofficient
):
self.distance = distance
self.consumption = consumption
self.charging_coefficient = charging_coefficient
def path_distance(self, G, path):
sum_weights(G, path, weight=DISTANCE_KEY)
def path_consumption(self, G, path):
sum_weights(G, path, weight=CONSUMPTION_KEY)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment