Skip to content

Commit

Permalink
feat: implement Edge's map based on placeID mapping
Browse files Browse the repository at this point in the history
issue: #351
  • Loading branch information
CodeBear801 committed May 28, 2020
1 parent 457b34b commit fbe4b6f
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 191 deletions.
7 changes: 2 additions & 5 deletions integration/service/oasis/stationgraph/dijkstra.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ func dijkstra(g Graph, start, end nodeID) []nodeID {
return nil
}
if currID == end {
// to be removed
//glog.Infof("+++ len(queryHeap.m) = %v \n", len(m.m))

return m.retrieve(currID)
}

Expand All @@ -31,8 +28,8 @@ func dijkstra(g Graph, start, end nodeID) []nodeID {
glog.Errorf("No connectivity between %+v and %+v which is unexpected, check your logic.\n", currID, targetID)
}

len := g.Edge(currID, targetID).distance
t := g.Edge(currID, targetID).duration
len := g.Edge(currID, targetID).Distance
t := g.Edge(currID, targetID).Duration

// todo
// !g.Node(currID).tooNearToCurrentNode(g.Node(targetID), len)
Expand Down
9 changes: 3 additions & 6 deletions integration/service/oasis/stationgraph/edge.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package stationgraph

import "github.com/Telenav/osrm-backend/integration/service/oasis/internal/common"

type edgeID struct {
fromNodeID nodeID
toNodeID nodeID
}

type edgeMetric struct {
distance float64
duration float64
}

type edge struct {
edgeId edgeID
edgeMetric *edgeMetric
edgeMetric *common.Weight
}
2 changes: 1 addition & 1 deletion integration/service/oasis/stationgraph/graph_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Graph interface {
AdjacentNodes(id nodeID) []nodeID

// Edge returns edge information between given two nodes
Edge(from, to nodeID) *edgeMetric
Edge(from, to nodeID) *common.Weight

// SetStart generates start node for the graph
SetStart(placeID common.PlaceID, targetState chargingstrategy.State, location *nav.Location) Graph
Expand Down
Loading

0 comments on commit fbe4b6f

Please sign in to comment.