-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from uavaustin/tangent
Restructured to abstract algorithm part from pathfinder object
- Loading branch information
Showing
27 changed files
with
713 additions
and
563 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "pathfinder" | ||
version = "0.0.0" | ||
version = "1.0.0" | ||
authors = ["UAV Austin <[email protected]>"] | ||
license = "MIT" | ||
|
||
|
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,27 @@ | ||
// algorithm.rs | ||
// trait that defines minimum requirement for a pathfinding algorithm | ||
|
||
use super::*; | ||
|
||
pub trait Algorithm { | ||
type Config; | ||
|
||
fn init( | ||
&mut self, | ||
config: Self::Config, | ||
flyzones: Vec<Vec<Location>>, | ||
obstacles: Vec<Obstacle>, | ||
); | ||
fn adjust_path<T>(&mut self, start: Location, end: Location) | ||
-> Option<LinkedList<Waypoint<T>>>; | ||
|
||
// Getters | ||
fn get_config(&self) -> Self::Config; | ||
fn get_flyzone(&mut self) -> &Vec<Vec<Location>>; | ||
fn get_obstacles(&self) -> &Vec<Obstacle>; | ||
|
||
// Setters | ||
fn set_config(&mut self, config: Self::Config); | ||
fn set_flyzone(&mut self, flyzone: Vec<Vec<Location>>); | ||
fn set_obstacles(&mut self, obstacles: Vec<Obstacle>); | ||
} |
Oops, something went wrong.