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

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.

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.

the main entry for planning.

start : starting grid

goal : goal grid

usejps: true for using jps, false for using A*

max_expand : max number of the depth in searching.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.