Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement type to record internal solution #205

Merged
merged 2 commits into from
Mar 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions integration/oasis/solution/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
package solution defines internal foramt for recording single solution result.
It isolates internal calculation logic and final restful response:
- Internal algorithm will calculate result in this format.
- In the end, oasis will use this format to generate restful response.
*/
package solution
26 changes: 26 additions & 0 deletions integration/oasis/solution/solution.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package solution

// Solution contains summary and selected charge stations
type Solution struct {
Distance float64
Duration float64
RemainingRage float64
Weight float64
ChargeStations []*ChargeStation
}

// ChargeStation contains all information related with specific charge station
type ChargeStation struct {
Location Location
StationID string
ArrivalEnergy float64
WaitTime float64
ChargeTime float64
ChargeRange float64
}

// Location defines the geo location of a station
type Location struct {
Lat float64
Lon float64
}