pub struct AgentStep<E, M: Model<E>> {
pub tag: &'static str,
pub delay: Duration,
pub priority: EventPriority,
pub logic: Box<dyn FnOnce(&mut EventContext<E, M>, &mut M, &mut VecDeque<AgentStep<E, M>>)>,
}Expand description
Represents a single step in an agent’s workflow.
This structure holds the logic and scheduling parameters for a specific action within the simulation.
Fields§
§tag: &'static strA descriptive tag for the step, used for logging and debugging purposes.
delay: DurationThe time delay before this step is executed.
priority: EventPriorityThe event priority, determining the order of execution within the same simulation time.
logic: Box<dyn FnOnce(&mut EventContext<E, M>, &mut M, &mut VecDeque<AgentStep<E, M>>)>The logic to be executed for this step.
The closure is provided with the current event context, the model instance, and a mutable reference to the queue of subsequent steps, allowing for dynamic modification of the remaining workflow.
Trait Implementations§
Auto Trait Implementations§
impl<E, M> Freeze for AgentStep<E, M>
impl<E, M> !RefUnwindSafe for AgentStep<E, M>
impl<E, M> !Send for AgentStep<E, M>
impl<E, M> !Sync for AgentStep<E, M>
impl<E, M> Unpin for AgentStep<E, M>
impl<E, M> UnsafeUnpin for AgentStep<E, M>
impl<E, M> !UnwindSafe for AgentStep<E, M>
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> 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