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

remove relative imports

parent 745b397e
No related branches found
No related tags found
No related merge requests found
from dataclasses import dataclass
from typing import Tuple, Union, NewType, Dict, Any
Node = int
......
......@@ -126,7 +126,7 @@ class ChargingFunction:
if soc > capacity:
# Return max charge time
return capacity / c
elif soc < 0:
if soc < 0:
# Return min charge time
return 0
......
......@@ -2,9 +2,9 @@ from typing import Dict
import networkx as nx
from .T import SoCProfile, SoCFunction, ChargingFunction, Label
from ..T import Node, SoC, Time
from ..graph_tools import charging_cofficient, consumption
from evrouting.T import Node, SoC
from evrouting.graph_tools import charging_cofficient, consumption
from evrouting.charge.T import SoCProfile, SoCFunction, ChargingFunction, Label
class SoCProfileFactory:
......
......@@ -4,16 +4,15 @@ from math import inf
import networkx as nx
from evrouting.T import Node, SoC
from evrouting.utils import PriorityQueue
from evrouting.graph_tools import distance
from evrouting.charge.T import SoCFunction, Label
from evrouting.charge.utils import LabelPriorityQueue, keys
from evrouting.charge.factories import (
ChargingFunctionMap,
SoCFunctionFactory,
SoCProfileFactory
)
from ..graph_tools import distance
from .T import SoCFunction, Label
from .utils import LabelPriorityQueue, keys
def shortest_path(G: nx.Graph, charging_stations: set, s: Node, t: Node,
initial_soc: SoC, final_soc: SoC, capacity: SoC):
......
from typing import Any, Dict, List
from math import inf
from evrouting.utils import PriorityQueue
from evrouting.T import SoC, Time
from .T import Label, SoCFunction
from .factories import SoCFunctionFactory
from evrouting.charge.T import Label, SoCFunction
from evrouting.charge.factories import SoCFunctionFactory
class LabelPriorityQueue(PriorityQueue):
......
......@@ -45,8 +45,7 @@ class PriorityQueue:
item = self.pq[0][-1]
if item is not self.REMOVED:
return item
else:
heappop(self.pq)
heappop(self.pq)
raise KeyError('Empty queue.')
def __bool__(self) -> bool:
......
import networkx as nx
from copy import copy
from typing import Set
from evrouting.T import Node, ChargingCoefficient
......
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