pub struct Assignment { /* private fields */ }Expand description
Implementations§
Source§impl Assignment
impl Assignment
Sourcepub const fn from_bundles(bundles: Vec<Bundle<TaskId>>) -> Self
pub const fn from_bundles(bundles: Vec<Bundle<TaskId>>) -> Self
An assignment from one bundle per agent, in agent order.
Sourcepub fn bundle_mut(&mut self, agent: AgentId) -> &mut Bundle<TaskId>
pub fn bundle_mut(&mut self, agent: AgentId) -> &mut Bundle<TaskId>
Sourcepub fn holder(&self, task: TaskId) -> Option<AgentId>
pub fn holder(&self, task: TaskId) -> Option<AgentId>
The agent holding task; None when no agent holds it. When several do, the one with
the smallest identifier.
Sourcepub fn value(&self) -> u64
pub fn value(&self) -> u64
The total value: the sum of the bundles’ values, saturating at u64::MAX.
Sourcepub fn is_conflict_free(&self) -> bool
pub fn is_conflict_free(&self) -> bool
Whether every task is held by at most one agent.
Trait Implementations§
Source§impl Clone for Assignment
impl Clone for Assignment
Source§impl Debug for Assignment
impl Debug for Assignment
Source§impl Default for Assignment
impl Default for Assignment
impl Eq for Assignment
Source§impl PartialEq for Assignment
impl PartialEq for Assignment
impl StructuralPartialEq for Assignment
Auto Trait Implementations§
impl Forget for Assignment
impl Freeze for Assignment
impl Move for Assignment
impl RefUnwindSafe for Assignment
impl Send for Assignment
impl Sync for Assignment
impl Unpin for Assignment
impl UnsafeUnpin for Assignment
impl UnwindSafe for Assignment
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