pub struct ActiveTask<D: Domain> {
pub end: u64,
pub agent: AgentId,
pub task: Box<dyn Task<D>>,
}
Expand description
A task associated to an agent and that is being processed by the planner.
Fields§
§end: u64
the end tick of this task
agent: AgentId
the agent executing this task
task: Box<dyn Task<D>>
the actual task
Implementations§
Source§impl<D: Domain> ActiveTask<D>
impl<D: Domain> ActiveTask<D>
Sourcepub fn new(
agent: AgentId,
task: Box<dyn Task<D>>,
tick: u64,
state_diff: StateDiffRef<'_, D>,
) -> Self
pub fn new( agent: AgentId, task: Box<dyn Task<D>>, tick: u64, state_diff: StateDiffRef<'_, D>, ) -> Self
Creates a new active task, computes the end from task and the state_diff.
Sourcepub fn new_with_end(end: u64, agent: AgentId, task: Box<dyn Task<D>>) -> Self
pub fn new_with_end(end: u64, agent: AgentId, task: Box<dyn Task<D>>) -> Self
Creates a new active task with a specified end.
Trait Implementations§
Source§impl<D: Domain> Clone for ActiveTask<D>
impl<D: Domain> Clone for ActiveTask<D>
Source§impl<D: Domain> Debug for ActiveTask<D>
impl<D: Domain> Debug for ActiveTask<D>
Source§impl<D: Domain> Display for ActiveTask<D>
impl<D: Domain> Display for ActiveTask<D>
Source§impl<D: Domain> Hash for ActiveTask<D>
impl<D: Domain> Hash for ActiveTask<D>
Source§impl<D: Domain> Ord for ActiveTask<D>
impl<D: Domain> Ord for ActiveTask<D>
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Active tasks are ordered first by time of ending, then by agent id
1.21.0 · 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
Source§impl<D: Domain> PartialEq for ActiveTask<D>
impl<D: Domain> PartialEq for ActiveTask<D>
Source§impl<D: Domain> PartialOrd for ActiveTask<D>
impl<D: Domain> PartialOrd for ActiveTask<D>
impl<D: Domain> Eq for ActiveTask<D>
Auto Trait Implementations§
impl<D> Freeze for ActiveTask<D>
impl<D> !RefUnwindSafe for ActiveTask<D>
impl<D> Send for ActiveTask<D>
impl<D> Sync for ActiveTask<D>
impl<D> Unpin for ActiveTask<D>
impl<D> !UnwindSafe for ActiveTask<D>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.