Add bucket queue and PriorityQueueByKey
This commit is contained in:
parent
ffe51bede9
commit
b8f83ec4eb
7 changed files with 245 additions and 21 deletions
|
|
@ -8,6 +8,7 @@ use crate::examples::HashMapMap;
|
|||
use factorio_core::misc::Map;
|
||||
use factorio_core::{prelude::*, visualize::Visualize};
|
||||
use factorio_graph::priority_queue::PriorityQueue;
|
||||
use factorio_graph::priority_queue::PriorityQueueByKey;
|
||||
use factorio_graph::wheighted_graph::WheightedGraph;
|
||||
use factorio_graph::wheighted_graph::shortest_path::QueueObject;
|
||||
use factorio_graph::wheighted_graph::shortest_path::a_star;
|
||||
|
|
@ -26,8 +27,7 @@ pub struct ConflictAvoidance<P> {
|
|||
|
||||
impl<P> SinglePathfinder for ConflictAvoidance<P>
|
||||
where
|
||||
P: PriorityQueue<QueueObject<(Position, Direction)>> + std::fmt::Debug,
|
||||
P::Handle: std::fmt::Debug,
|
||||
P: PriorityQueueByKey<QueueObject<(Position, Direction)>>,
|
||||
{
|
||||
fn find_paths<M: crate::Map>(
|
||||
&self,
|
||||
|
|
@ -280,8 +280,7 @@ impl WheightedGraph for MapInternal<'_> {
|
|||
impl Problem {
|
||||
pub fn find_path<P>(&mut self) -> bool
|
||||
where
|
||||
P: PriorityQueue<QueueObject<(Position, Direction)>> + std::fmt::Debug,
|
||||
P::Handle: std::fmt::Debug,
|
||||
P: PriorityQueueByKey<QueueObject<(Position, Direction)>>,
|
||||
{
|
||||
let _span = span!(Level::TRACE, "find_path").entered();
|
||||
for i in 0..self.start.len() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue