Skip to content

Commit

Permalink
Merge pull request #8 from uavaustin/tangent
Browse files Browse the repository at this point in the history
Restructured to abstract algorithm part from pathfinder object
  • Loading branch information
szhu64 authored May 14, 2019
2 parents ccd1328 + 86af3a1 commit b9196c1
Show file tree
Hide file tree
Showing 27 changed files with 713 additions and 563 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
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"

Expand Down
27 changes: 27 additions & 0 deletions src/algorithm.rs
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>);
}
Loading

0 comments on commit b9196c1

Please sign in to comment.