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

Position.direction_to() should return all directions which are shortest path #98

Open
Gerenuk opened this issue Jul 23, 2021 · 2 comments
Labels
enhancement New feature or request starter-kit anything related to kit updates

Comments

@Gerenuk
Copy link

Gerenuk commented Jul 23, 2021

Currently, Position.direction_to(target_pos: Position) -> DIRECTIONS will return only a single direction. However, most of the time there are two possible directions for the shortest path. For implementing a move optimizer it is important to know all possible shortest path directions as there are usually 2 (unless some coordinate is identical).

Therefore, I suggest to implement the function as Position.direction_to(target_pos: Position) -> Set[DIRECTION] which returns a set of all directions in order to most quickly reach the destination.

For example Position(1,1).direction_to(Position(2,2)) -> {"s", "e"}

@StoneT2000 StoneT2000 added enhancement New feature or request starter-kit anything related to kit updates labels Jul 23, 2021
@StoneT2000
Copy link
Member

per discussion on discord. Not sure if this will be added as I also think this is a matter of preference. Leaving this issue open so that other competitors can see and also consider using since it is helpful depending on how your navigation algo works

@Gerenuk
Copy link
Author

Gerenuk commented Jul 25, 2021

Or the new function could be called directions_to(...)
Then one can leave the old function. Even though I cannot imagine that someone would not care about knowing all directions. If the arbitrary direction is blocked, it would be a hassle trying to figure out the remaining optimal direction. Unless you are fine with workers standing still due to being blocked and not going the equally shortest path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request starter-kit anything related to kit updates
Projects
None yet
Development

No branches or pull requests

2 participants