pub struct IdleTask;
Expand description
An idle task of duration 1 that is used by the planner when the task of an agent is not known.
Trait Implementations§
Source§impl<D: Domain> Task<D> for IdleTask
impl<D: Domain> Task<D> for IdleTask
Source§fn weight(
&self,
_tick: u64,
_state_diff: StateDiffRef<'_, D>,
_agent: AgentId,
) -> f32
fn weight( &self, _tick: u64, _state_diff: StateDiffRef<'_, D>, _agent: AgentId, ) -> f32
Returns the relative weight of the task for the given agent in the given tick and world state, by default weight is 1.0.
Source§fn duration(
&self,
_tick: u64,
_state_diff: StateDiffRef<'_, D>,
_agent: AgentId,
) -> TaskDuration
fn duration( &self, _tick: u64, _state_diff: StateDiffRef<'_, D>, _agent: AgentId, ) -> TaskDuration
Returns the duration of the task, for a given agent in a given tick and world state.
Source§fn execute(
&self,
_tick: u64,
_state_diff: StateDiffRefMut<'_, D>,
_agent: AgentId,
) -> Option<Box<dyn Task<D>>>
fn execute( &self, _tick: u64, _state_diff: StateDiffRefMut<'_, D>, _agent: AgentId, ) -> Option<Box<dyn Task<D>>>
Executes one step of the task for the given agent on the given tick and world state.
Source§fn is_valid(
&self,
_tick: u64,
_state_diff: StateDiffRef<'_, D>,
_agent: AgentId,
) -> bool
fn is_valid( &self, _tick: u64, _state_diff: StateDiffRef<'_, D>, _agent: AgentId, ) -> bool
Returns if the task is valid for the given agent in the given tick and world state.
Source§fn display_action(&self) -> D::DisplayAction
fn display_action(&self) -> D::DisplayAction
Returns the display actions corresponding to this task.
Source§fn box_clone(&self) -> Box<dyn Task<D>>
fn box_clone(&self) -> Box<dyn Task<D>>
Utility method for cloning, since
Self: Clone
is not object-safe. Read moreimpl StructuralPartialEq for IdleTask
Auto Trait Implementations§
impl Freeze for IdleTask
impl RefUnwindSafe for IdleTask
impl Send for IdleTask
impl Sync for IdleTask
impl Unpin for IdleTask
impl UnwindSafe for IdleTask
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.