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/Generate connectivity between charge stations near to low ene…
…rgy point (#189) * feat: implement logic for finding charge stations when energy is low - implement logic to calculate weight between charge stations around low energy locations. - implement related unit tests issue: #183
- Loading branch information
1 parent
ba7f7e6
commit 6462a11
Showing
16 changed files
with
798 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package stationfinder | ||
|
||
const destLocationID string = "dest_location" | ||
|
||
type destIterator struct { | ||
location *StationCoordinate | ||
} | ||
|
||
func NewDestIter(location *StationCoordinate) *destIterator { | ||
return &destIterator{ | ||
location: location, | ||
} | ||
} | ||
|
||
func (di *destIterator) iterateNearbyStations() <-chan ChargeStationInfo { | ||
c := make(chan ChargeStationInfo, 1) | ||
|
||
go func() { | ||
defer close(c) | ||
station := ChargeStationInfo{ | ||
ID: destLocationID, | ||
Location: *di.location, | ||
} | ||
c <- station | ||
}() | ||
|
||
return c | ||
} |
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.