pub struct GraphSearch {
pub path_: Vec<State>,
pub turnings: Vec<(i32, i32, i32)>,
pub fmap_: Option<HashSet<(i32, i32, i32)>>,
pub omap_: HashSet<(i32, i32, i32)>,
pub xbound: [i32; 2],
pub ybound: [i32; 2],
pub zbound: [i32; 2],
pub goal: (i32, i32, i32),
pub use_jps_: bool,
/* private fields */
}
Expand description
GraphSearch
is the struct type for path finding.
pq_
: a Priorty Queue for saving possible nodes.
hm_
: a HashMap for saving nodes that have been visited.
path_
: the path in the forward order, i.e. from start to goal.
turnings
: the turning points along the path in the forward order, including start and goal.
turnings
can be differenced for constructing lines, e.g. line[k] := (turnings[k], turnings[k+1])
ns_
: all neighbors in terms of relative position.
jn3d_
: all jps neighbors.
fmap_
: HashSet containing all free grids.
omap
: HashSet containing all occupied grids.
Fields§
§path_: Vec<State>
the path in the forward order, i.e. from start to goal.
turnings: Vec<(i32, i32, i32)>
the turning points along the path in the forward order, including start and goal.
turnings
can be differenced for constructing lines, e.g. line[k] := (turnings[k], turnings[k+1])
fmap_: Option<HashSet<(i32, i32, i32)>>
free map. if it’s None
, a grid will be free as long as it is within the box defined by xdim × ydim × zdim.
otherwise, when it’s Some
, the check for being contained in the free map is additionally needed to check whether a grid is free.
omap_: HashSet<(i32, i32, i32)>
occupied map
xbound: [i32; 2]
x-, y-, z- dimensions
ybound: [i32; 2]
§zbound: [i32; 2]
§goal: (i32, i32, i32)
goal
use_jps_: bool
use_jps
Implementations§
Source§impl GraphSearch
impl GraphSearch
Sourcepub fn new_v1(
fmap_: Option<HashSet<(i32, i32, i32)>>,
omap_: HashSet<(i32, i32, i32)>,
xbound: [i32; 2],
ybound: [i32; 2],
zbound: [i32; 2],
eps_: f32,
) -> Self
pub fn new_v1( fmap_: Option<HashSet<(i32, i32, i32)>>, omap_: HashSet<(i32, i32, i32)>, xbound: [i32; 2], ybound: [i32; 2], zbound: [i32; 2], eps_: f32, ) -> Self
create a GraphSearch
instance, with maps given in terms of HashMap.
fmap_
: free map, containing all coordinates of free grids.
omap_
: occupied map, containing all coordinates of occupied grids.
xdim
: upper boundary on x-axis.
ydim
: upper boundary on y-axis.
zdim
: upper boundary on z-axis.
eps_
: a scalar in calculating the costs.
Sourcepub fn new_v2(
map: &[bool],
xbound: [i32; 2],
ybound: [i32; 2],
zbound: [i32; 2],
eps_: f32,
) -> Self
pub fn new_v2( map: &[bool], xbound: [i32; 2], ybound: [i32; 2], zbound: [i32; 2], eps_: f32, ) -> Self
create a GraphSearch
instance, with the map given in terms of binary-valued array.
map
: the map that is reshaped into 1d array, true
means occupied, false
means free.
xdim
: upper boundary on x-axis.
ydim
: upper boundary on y-axis.
zdim
: upper boundary on z-axis.
eps_
: a scalar in calculating the costs.
Source§impl GraphSearch
impl GraphSearch
Trait Implementations§
Source§impl Debug for GraphSearch
impl Debug for GraphSearch
Source§impl Default for GraphSearch
impl Default for GraphSearch
Source§fn default() -> GraphSearch
fn default() -> GraphSearch
Auto Trait Implementations§
impl Freeze for GraphSearch
impl RefUnwindSafe for GraphSearch
impl Send for GraphSearch
impl Sync for GraphSearch
impl Unpin for GraphSearch
impl UnwindSafe for GraphSearch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more