From 5ea6e0012acff73b78f3360451e244a772d1bf6c Mon Sep 17 00:00:00 2001 From: "niehues.mark@gmail.com" <niehues.mark@gmail.com> Date: Thu, 12 Mar 2020 14:21:09 +0100 Subject: [PATCH] intial tests --- evrouting/charge/__init__.py | 1 + evrouting/charge/routing.py | 16 ++++++++++++++++ evrouting/gasstation/__init__.py | 1 + evrouting/gasstation/routing.py | 16 ++++++++++++++++ tests/config.py | 2 ++ 5 files changed, 36 insertions(+) diff --git a/evrouting/charge/__init__.py b/evrouting/charge/__init__.py index e69de29..0e1bcfd 100644 --- a/evrouting/charge/__init__.py +++ b/evrouting/charge/__init__.py @@ -0,0 +1 @@ +from .routing import shortest_path \ No newline at end of file diff --git a/evrouting/charge/routing.py b/evrouting/charge/routing.py index e69de29..e9a2def 100644 --- a/evrouting/charge/routing.py +++ b/evrouting/charge/routing.py @@ -0,0 +1,16 @@ +import networkx as nx + + +def shortest_path(G: nx.Graph, s, t, b_0: float, b_t: float, U: float): + """ + Calculates shortest path using the CHarge algorithm. + + :param G: Input Graph + :param s: Start Node identifier + :param t: End Node identifier + :param b_0: Start SoC + :param b_t: End SoC + :param U: Capacity + :return: + """ + pass diff --git a/evrouting/gasstation/__init__.py b/evrouting/gasstation/__init__.py index e69de29..0e1bcfd 100644 --- a/evrouting/gasstation/__init__.py +++ b/evrouting/gasstation/__init__.py @@ -0,0 +1 @@ +from .routing import shortest_path \ No newline at end of file diff --git a/evrouting/gasstation/routing.py b/evrouting/gasstation/routing.py index e69de29..55049b6 100644 --- a/evrouting/gasstation/routing.py +++ b/evrouting/gasstation/routing.py @@ -0,0 +1,16 @@ +import networkx as nx + + +def shortest_path(G: nx.Graph, s, t, b_0: float, b_t: float, U: float): + """ + Calculates shortest path using a generalized gas station algorithm. + + :param G: Input Graph + :param s: Start Node identifier + :param t: End Node identifier + :param b_0: Start SoC + :param b_t: End SoC + :param U: Capacity + :return: + """ + pass diff --git a/tests/config.py b/tests/config.py index e73cda4..d8f3408 100644 --- a/tests/config.py +++ b/tests/config.py @@ -9,6 +9,8 @@ edge_case = { 'b_0': 0, 'b_t': 0, 'U': 4, + 's': 0, + 't': 2, 'nodes': [ Node('s', charging_coeff=1), Node('a', charging_coeff=2), -- GitLab