[−][src]Struct hierarchical_pathfinding::PathCacheConfig
Options for configuring the PathCache
Default options:
assert_eq!( PathCacheConfig { chunk_size: 8, cache_paths: true, keep_insertions: true, a_star_fallback: true, perfect_paths: false, }, Default::default() );
Fields
chunk_size: usize
The size of the individual Chunks (defaults to 8
)
cache_paths: bool
true
(default): store the Paths inside each Chunk.
false
: only store the Cost of the Path.
If set to false, calculating the full Path between two Points takes significantly more time.
See AbstractPath
for more details.
keep_insertions: bool
true
(default): any Points inserted when calling find_path or find_paths are left in the Graph.
false
: the Points are deleted at the end of those functions.
Keeping Points slightly increases future search times and memory usage, but makes searches to or from those same Points a lot faster.
a_star_fallback: bool
true
(default): When a Path is short (roughly Length < 2 * chunk_size
), a regular
A* search is performed on the Grid after HPA* calculated a Path to confirm the
existence and length.
false
: The Paths are left as they are.
Setting this option to false will improve performance a bit, but the Paths will take seemingly random detours that makes them longer than they should be.
perfect_paths: bool
true
: Nodes are placed on every open entrance of a Chunk. This means that the resulting
Paths are always the most optimal ones, but both Memory Usage and Performance are worse.
false
(default): Nodes are placed on only some chunk entrances.
The exact effect depends greatly on the Grid and how the Chunks and their entrances align.
Methods
impl PathCacheConfig
[src]
pub const LOW_MEM: PathCacheConfig
[src]
an example PathCacheConfig with options set to reduce Memory Usage
Values:
assert_eq!( PathCacheConfig { chunk_size: 16, cache_paths: false, keep_insertions: false, a_star_fallback: true, perfect_paths: false, }, PathCacheConfig::LOW_MEM );
pub const HIGH_PERFORMANCE: PathCacheConfig
[src]
an example PathCacheConfig with options set to improve Performance
Values:
assert_eq!( PathCacheConfig { chunk_size: 8, cache_paths: true, keep_insertions: true, a_star_fallback: false, perfect_paths: false, }, PathCacheConfig::HIGH_PERFORMANCE );
Trait Implementations
impl Clone for PathCacheConfig
[src]
fn clone(&self) -> PathCacheConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<PathCacheConfig> for PathCacheConfig
[src]
fn eq(&self, other: &PathCacheConfig) -> bool
[src]
fn ne(&self, other: &PathCacheConfig) -> bool
[src]
impl Copy for PathCacheConfig
[src]
impl Default for PathCacheConfig
[src]
fn default() -> PathCacheConfig
[src]
impl Debug for PathCacheConfig
[src]
Auto Trait Implementations
impl Send for PathCacheConfig
impl Sync for PathCacheConfig
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,