From afd1263ce1b52c8e04eec2dd88738ed322ada467 Mon Sep 17 00:00:00 2001 From: fonsinchen Date: Mon, 17 Mar 2014 20:33:26 +0000 Subject: (svn r26411) -Change [FS#5941]: Use better distance metric for link graph (MildaIV) --- src/linkgraph/linkgraph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/linkgraph/linkgraph.cpp') diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index e8c792c37..d41c3494d 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -155,7 +155,7 @@ void LinkGraph::UpdateDistances(NodeID id, TileIndex xy) for (NodeID other = 0; other < this->Size(); ++other) { if (other == id) continue; this->edges[id][other].distance = this->edges[other][id].distance = - DistanceManhattan(xy, Station::Get(this->nodes[other].station)->xy); + DistanceMaxPlusManhattan(xy, Station::Get(this->nodes[other].station)->xy); } } @@ -187,7 +187,7 @@ NodeID LinkGraph::AddNode(const Station *st) new_edges[new_node].next_edge = INVALID_NODE; for (NodeID i = 0; i <= new_node; ++i) { - uint distance = DistanceManhattan(st->xy, Station::Get(this->nodes[i].station)->xy); + uint distance = DistanceMaxPlusManhattan(st->xy, Station::Get(this->nodes[i].station)->xy); new_edges[i].Init(distance); this->edges[i][new_node].Init(distance); } -- cgit v1.2.3-54-g00ecf