pub struct IntervalCSP {
pub intervals: HashMap<u64, TemporalInterval>,
pub constraints: HashMap<(u64, u64), Vec<AllenRelation>>,
pub solution: Option<HashMap<u64, TemporalInterval>>,
}Expand description
Interval constraint satisfaction problem
Fields§
§intervals: HashMap<u64, TemporalInterval>§constraints: HashMap<(u64, u64), Vec<AllenRelation>>§solution: Option<HashMap<u64, TemporalInterval>>Implementations§
Source§impl IntervalCSP
impl IntervalCSP
Sourcepub fn add_interval(&mut self, interval: TemporalInterval)
pub fn add_interval(&mut self, interval: TemporalInterval)
Add an interval to the CSP
Sourcepub fn add_constraint(&mut self, id1: u64, id2: u64, relation: AllenRelation)
pub fn add_constraint(&mut self, id1: u64, id2: u64, relation: AllenRelation)
Add a constraint between two intervals
Sourcepub fn satisfies_relation(
&self,
interval1: &TemporalInterval,
interval2: &TemporalInterval,
relation: &AllenRelation,
) -> bool
pub fn satisfies_relation( &self, interval1: &TemporalInterval, interval2: &TemporalInterval, relation: &AllenRelation, ) -> bool
Check if two intervals satisfy a given relation
Sourcepub fn get_solution(&self) -> Option<&HashMap<u64, TemporalInterval>>
pub fn get_solution(&self) -> Option<&HashMap<u64, TemporalInterval>>
Get the solution if it exists
Auto Trait Implementations§
impl Freeze for IntervalCSP
impl RefUnwindSafe for IntervalCSP
impl Send for IntervalCSP
impl Sync for IntervalCSP
impl Unpin for IntervalCSP
impl UnsafeUnpin for IntervalCSP
impl UnwindSafe for IntervalCSP
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more