pub enum Constraint {
Vertex {
agent: AgentId,
vertex: Vertex,
time: Time,
},
Edge {
agent: AgentId,
from: Vertex,
to: Vertex,
time: Time,
},
PositiveVertex {
agent: AgentId,
vertex: Vertex,
time: Time,
},
PositiveEdge {
agent: AgentId,
from: Vertex,
to: Vertex,
time: Time,
},
}Expand description
Forbids or requires one agent one vertex or one move at one time.
Variants§
Vertex
agent must not occupy vertex at time.
Fields
Edge
agent must not move from -> to between time and time + 1.
Fields
PositiveVertex
agent must occupy vertex at time; no other agent may (disjoint splitting, Li
et al. 2019).
Fields
PositiveEdge
agent must move from -> to between time and time + 1, with from != to; no
other agent may be at from at time or at to at time + 1, or move to -> from
then.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Returns true for Constraint::PositiveVertex and Constraint::PositiveEdge.
Sourcepub fn implied_for(&self, other: AgentId) -> Vec<Self>
pub fn implied_for(&self, other: AgentId) -> Vec<Self>
The negative constraints that this positive constraint implies for other, an
agent other than the constrained one; nothing for a negative constraint.
Sourcepub fn is_violated_by(&self, path: &[Vertex]) -> bool
pub fn is_violated_by(&self, path: &[Vertex]) -> bool
Returns true if path (with goal-stay) breaks this constraint, whichever agent it
names.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
impl Copy for Constraint
Source§impl Debug for Constraint
impl Debug for Constraint
impl Eq for Constraint
Source§impl Hash for Constraint
impl Hash for Constraint
Source§impl Ord for Constraint
impl Ord for Constraint
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
Source§impl PartialOrd for Constraint
impl PartialOrd for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Forget for Constraint
impl Freeze for Constraint
impl Move for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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