forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/oasis refactor phase3 step2 (#368)
* refactor: add package of graph and place issue: #364
- Loading branch information
1 parent
85f1a4f
commit d21e5dd
Showing
140 changed files
with
1,518 additions
and
1,516 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
integration/service/oasis/chargingstrategy/null_charge_strategy.go
This file was deleted.
Oops, something went wrong.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
integration/service/oasis/graph/chargingstrategy/fake_charge_strategy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package chargingstrategy | ||
|
||
type fakeChargeStrategy struct { | ||
} | ||
|
||
// NewFakeChargeStrategy creates fakeChargeStrategy used to bypass unit tests | ||
func NewFakeChargeStrategy() *fakeChargeStrategy { | ||
return &fakeChargeStrategy{} | ||
} | ||
|
||
func (f *fakeChargeStrategy) CreateChargingStates() []State { | ||
return []State{} | ||
} | ||
|
||
func (f *fakeChargeStrategy) EvaluateCost(arrivalEnergy float64, targetState State) ChargingCost { | ||
return ChargingCost{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package graph |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
...rvice/oasis/stationgraph/edge_2_weight.go → ...oasis/graph/stationgraph/edge_2_weight.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
package stationgraph | ||
|
||
import "github.com/Telenav/osrm-backend/integration/service/oasis/internal/common" | ||
import ( | ||
"github.com/Telenav/osrm-backend/integration/service/oasis/internal/entity" | ||
) | ||
|
||
type place2placeID struct { | ||
from common.PlaceID | ||
to common.PlaceID | ||
from entity.PlaceID | ||
to entity.PlaceID | ||
} | ||
type edgeID2EdgeData map[place2placeID]*common.Weight | ||
type edgeID2EdgeData map[place2placeID]*entity.Weight | ||
|
||
func newEdgeID2EdgeData() edgeID2EdgeData { | ||
return make(edgeID2EdgeData, 5000000) | ||
} | ||
|
||
func (edge2Weight edgeID2EdgeData) get(id place2placeID) *common.Weight { | ||
func (edge2Weight edgeID2EdgeData) get(id place2placeID) *entity.Weight { | ||
return edge2Weight[id] | ||
} | ||
|
||
func (edge2Weight edgeID2EdgeData) add(id place2placeID, weight *common.Weight) { | ||
func (edge2Weight edgeID2EdgeData) add(id place2placeID, weight *entity.Weight) { | ||
edge2Weight[id] = weight | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.