pub struct TaskInstance<G> { /* private fields */ }Expand description
A validated task-assignment MAPF instance: each agent must end at one of its candidate goals, and no two agents at the same one.
Starts are pairwise distinct, and every start and candidate goal is a vertex of the graph. Agents may share candidate goals.
§Examples
use mapf_search::{Grid, TaskAgent, TaskInstance};
let grid = Grid::new(3, 1);
let anywhere = vec![0, 1, 2];
let agents = vec![
TaskAgent { start: 0, goals: anywhere.clone() },
TaskAgent { start: 2, goals: anywhere },
];
let instance = TaskInstance::new(grid, agents)?;
assert_eq!(instance.agents()[1].goals, [0, 1, 2]);Implementations§
Source§impl<G: Graph> TaskInstance<G>
impl<G: Graph> TaskInstance<G>
Sourcepub fn new(graph: G, agents: Vec<TaskAgent>) -> Result<Self, InstanceError>
pub fn new(graph: G, agents: Vec<TaskAgent>) -> Result<Self, InstanceError>
Creates a task-assignment instance after checking the agents against the graph.
§Errors
InstanceError::OutOfRangeif a start or a candidate goal is not a vertex ofgraph;InstanceError::SharedStartif two agents start at the same vertex.
Never InstanceError::SharedGoal: shared candidates are allowed, and the solver
assigns distinct goals.
Trait Implementations§
Source§impl<G: Clone> Clone for TaskInstance<G>
impl<G: Clone> Clone for TaskInstance<G>
Source§impl<G: Debug> Debug for TaskInstance<G>
impl<G: Debug> Debug for TaskInstance<G>
impl<G: Eq> Eq for TaskInstance<G>
Source§impl<G: PartialEq> PartialEq for TaskInstance<G>
impl<G: PartialEq> PartialEq for TaskInstance<G>
impl<G: PartialEq> StructuralPartialEq for TaskInstance<G>
Auto Trait Implementations§
impl<G> Forget for TaskInstance<G>
impl<G> Freeze for TaskInstance<G>where
G: Freeze,
impl<G> Move for TaskInstance<G>
impl<G> RefUnwindSafe for TaskInstance<G>where
G: RefUnwindSafe,
impl<G> Send for TaskInstance<G>where
G: Send,
impl<G> Sync for TaskInstance<G>where
G: Sync,
impl<G> Unpin for TaskInstance<G>where
G: Unpin,
impl<G> UnsafeUnpin for TaskInstance<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for TaskInstance<G>where
G: UnwindSafe,
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
Mutably borrows from an owned value. Read more