diff --git a/CHANGELOG-FORK.md b/CHANGELOG-FORK.md index 1d35faf80dc..e856ab38591 100644 --- a/CHANGELOG-FORK.md +++ b/CHANGELOG-FORK.md @@ -6,6 +6,7 @@ Changes from v10.3.0 - CHANGED for integration of pre-generated connectivity data with OASIS service [#339](https://github.com/Telenav/osrm-backend/pull/339) - CHANGED for internal refactoring, replace `Location` in `spatialindexer` to nav.Location, replace all name of `point` to `place` [#341](https://github.com/Telenav/osrm-backend/pull/341) - CHANGED for internal refactoring, move package oasis/solution, oasis/osrmhelper and oasis/searchhelper into oasis/internal [#343](https://github.com/Telenav/osrm-backend/pull/343) + - CHANGED for internal refactoring, improve performance for OASIS service, more information please go to [#344](https://github.com/Telenav/osrm-backend/issues/344) [#353](https://github.com/Telenav/osrm-backend/pull/353) - Bugfix: - Performance: - Tools: diff --git a/integration/service/oasis/chargingstrategy/fake_charge_strategy.go b/integration/service/oasis/chargingstrategy/fake_charge_strategy.go index 382c5cb6722..8aab825dbdf 100644 --- a/integration/service/oasis/chargingstrategy/fake_charge_strategy.go +++ b/integration/service/oasis/chargingstrategy/fake_charge_strategy.go @@ -54,7 +54,7 @@ func (f *fakeChargeStrategy) CreateChargingStates() []State { return f.stateCandidates } -var noNeedChargeCost = ChargingCost{ +var zeroChargeCost = ChargingCost{ Duration: 0.0, } @@ -69,7 +69,7 @@ func (f *fakeChargeStrategy) EvaluateCost(arrivalEnergy float64, targetState Sta if arrivalEnergy > targetState.Energy || util.Float64Equal(targetState.Energy, 0.0) { - return noNeedChargeCost + return zeroChargeCost } totalTime := 0.0 @@ -117,5 +117,5 @@ func (f *fakeChargeStrategy) EvaluateCost(arrivalEnergy float64, targetState Sta } } - return noNeedChargeCost + return zeroChargeCost } diff --git a/integration/service/oasis/internal/common/place.go b/integration/service/oasis/internal/common/place.go index a120ff081ae..9f0b4f16ae3 100644 --- a/integration/service/oasis/internal/common/place.go +++ b/integration/service/oasis/internal/common/place.go @@ -6,7 +6,7 @@ import ( "github.com/Telenav/osrm-backend/integration/api/nav" ) -// todo codebear801 change to a more variable name +// todo @codebear801 change to a more reasonable name // PlaceInfo -> PlaceWithLocation // RankedPlaceInfo -> TransferInfo diff --git a/integration/service/oasis/stationfinder/stationfinderalg/querier_impl_by_stationfinder.go b/integration/service/oasis/stationfinder/stationfinderalg/querier_impl_by_stationfinder.go index 15dfd23dc8d..2841d317aa6 100644 --- a/integration/service/oasis/stationfinder/stationfinderalg/querier_impl_by_stationfinder.go +++ b/integration/service/oasis/stationfinder/stationfinderalg/querier_impl_by_stationfinder.go @@ -69,6 +69,8 @@ func NewQuerierBasedOnWeightBetweenNeighborsChan(c chan stationfindertype.Weight return querier } +// NearByStationQuery finds near by stations by given placeID and return them in recorded sequence +// Returns nil if given placeID is not found or no connectivity func (q *querier) NearByStationQuery(placeID common.PlaceID) []*common.RankedPlaceInfo { if results, ok := q.id2QueryResults[placeID]; ok { return results @@ -77,6 +79,8 @@ func (q *querier) NearByStationQuery(placeID common.PlaceID) []*common.RankedPla } } +// GetLocation returns location of given station id +// Returns nil if given placeID is not found func (q *querier) GetLocation(placeID common.PlaceID) *nav.Location { if location, ok := q.id2Location[placeID]; ok { return location diff --git a/integration/service/oasis/stationgraph/node_graph.go b/integration/service/oasis/stationgraph/node_graph.go index 7db90242e70..342ec2d2721 100644 --- a/integration/service/oasis/stationgraph/node_graph.go +++ b/integration/service/oasis/stationgraph/node_graph.go @@ -164,7 +164,5 @@ func (g *nodeGraph) buildAdjacentList(id nodeID) []nodeID { } } - // to be removed - //glog.Infof("### len(physicalNodes) = %v, len(adjacentNodeIDs) = %v, numOfPhysicalNodesNeeded= %v\n", len(physicalNodes), len(adjacentNodeIDs), numOfPhysicalNodesNeeded*3) return adjacentNodeIDs }