Struct jps::GraphSearch
source · [−]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
sourceimpl 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.
sourceimpl GraphSearch
impl GraphSearch
Trait Implementations
sourceimpl Debug for GraphSearch
impl Debug for GraphSearch
sourceimpl Default for GraphSearch
impl Default for GraphSearch
sourcefn default() -> GraphSearch
fn default() -> GraphSearch
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for GraphSearch
impl Send for GraphSearch
impl Sync for GraphSearch
impl Unpin for GraphSearch
impl UnwindSafe for GraphSearch
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more