pub struct PlanningTask(pub NonZeroU64);
Expand description
A task to represent planning in the planning tree, if these need to be represented.
Tuple Fields§
§0: NonZeroU64
The duration of the planning task
Trait Implementations§
Source§impl Clone for PlanningTask
impl Clone for PlanningTask
Source§fn clone(&self) -> PlanningTask
fn clone(&self) -> PlanningTask
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PlanningTask
impl Debug for PlanningTask
Source§impl Hash for PlanningTask
impl Hash for PlanningTask
Source§impl PartialEq for PlanningTask
impl PartialEq for PlanningTask
Source§impl<D: Domain> Task<D> for PlanningTask
impl<D: Domain> Task<D> for PlanningTask
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 Eq for PlanningTask
impl StructuralPartialEq for PlanningTask
Auto Trait Implementations§
impl Freeze for PlanningTask
impl RefUnwindSafe for PlanningTask
impl Send for PlanningTask
impl Sync for PlanningTask
impl Unpin for PlanningTask
impl UnwindSafe for PlanningTask
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.