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

Oasis - Refactor package stationgraph to support charge station based graph #282

Closed
CodeBear801 opened this issue Apr 15, 2020 · 1 comment · Fixed by #307
Closed

Oasis - Refactor package stationgraph to support charge station based graph #282

CodeBear801 opened this issue Apr 15, 2020 · 1 comment · Fixed by #307
Assignees
Labels
Refactor Rewrite existing code in order to improve its readability, reusability or structure

Comments

@CodeBear801
Copy link

CodeBear801 commented Apr 15, 2020

This task is sub task of #231, and related with #241 and #242

background

  • In the package of stationgraph, there are graph, node, edge

    • graph contains start, end, and connectivity which is represented by a group of nodes
    • graph implement dijkstra
    • node contains neighbors, for previous situation, all the connectivity is known when graph was built
  • Here is how connectivity is generated for search along route for charge stations

    • Calculate a route from orig to dest
    • Identify the location which is needed for charging, such as, energy level is lower than a certain level
    • Take the location as center, create a query bounding box and search for near by charge stations
    • Calculate route between charge station pair of each location.
    • Construct graph, convert all information to node and its neighbors.
// simulate locations array contains 4 points: orig -> location1 -> location2 -> dest
// (1.1, 1.1) -> (2.2, 2.2) -> (3.3, 3.3) -> (4.4, 4.4)
// location1 will find 4 nearby charge stations
// location2 will find 2 nearby charge stations
// search service will provide results based on upper information.
// Table service will provide result for: 1(orig) -> 4(charge stations around location 1),
// 4(charge stations around location 1) -> 2(charge stations around location 2),
// 2(charge stations around location 2) -> 1(dest)
func TestCalculateWeightBetweenNeighbors(t *testing.T) {
...
  • New requirements
    • connectivity is generated during running time, each node will generate thousands of connectivity, its impossible to pre-build graph at beginning.
    • need to adjust graph, to make which based on abstract of node and edges, not exact instance
@CodeBear801 CodeBear801 added the Refactor Rewrite existing code in order to improve its readability, reusability or structure label Apr 15, 2020
@CodeBear801 CodeBear801 self-assigned this Apr 15, 2020
@CodeBear801
Copy link
Author

  • Add interface of neighbors
    • Provide function getNeighbors
    • neighborsPreGenerated
    • neighborsBuildOnTheFly

CodeBear801 added a commit that referenced this issue Apr 21, 2020
CodeBear801 added a commit that referenced this issue Apr 22, 2020
CodeBear801 added a commit that referenced this issue Apr 22, 2020
CodeBear801 added a commit that referenced this issue Apr 22, 2020
CodeBear801 added a commit that referenced this issue Apr 22, 2020
CodeBear801 added a commit that referenced this issue Apr 22, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 23, 2020
CodeBear801 added a commit that referenced this issue Apr 24, 2020
CodeBear801 added a commit that referenced this issue Apr 29, 2020
#307)

* refactor: change `edgeIDAndData` to `edge` and replace location definition with nav.Location
issue: #282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Rewrite existing code in order to improve its readability, reusability or structure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant