diff options
| author | Stefan Hansson <steha708@edu.liu.se> | 2020-12-16 08:06:10 +0100 |
|---|---|---|
| committer | Newbyte <steha708@liu.se> | 2020-12-16 08:06:10 +0100 |
| commit | a11a7b4cde5834781aa57e7f9c9a8a3a309d6411 (patch) | |
| tree | 3de6e7616a9f2db627ad80870e68c8a77f24709e /algorithms.py | |
| parent | 7d31854216fd893e1805c6dd40517f329ee3e886 (diff) | |
| download | tdde25-a11a7b4cde5834781aa57e7f9c9a8a3a309d6411.tar.gz | |
wip
Diffstat (limited to 'algorithms.py')
| -rw-r--r-- | algorithms.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/algorithms.py b/algorithms.py index 855c69e..3bd9f5e 100644 --- a/algorithms.py +++ b/algorithms.py @@ -73,25 +73,18 @@ def get_closest_node(nodes, source_node): Searches through all nodes in a specified grid and return node closes to source node. """ -def get_closest_node_id(nodes, source_node, transport_mode): - """ Search through all nodes and return the id of the node - that is closest to 'source_node'. """ min_node = None min_value = None for node in nodes: + print(source_node) print(node) length = length_haversine(source_node, node) - relevant_neighbours = get_relevant_neighbours(node, transport_mode) - - if (min_node is None or length < min_value) and relevant_neighbours: + if (min_node is None or length < min_value): min_node = node min_value = length - print("min_node: ") - print(min_node) - return min_node |
