pub trait UserContext<E, M: Model<E>> {
// Required methods
fn current_tick(&self) -> SimTime;
fn current_micro_step(&self) -> MicroStep;
fn schedule_event(
&mut self,
delay: Duration,
priority: EventPriority,
event_payload: E,
);
}Expand description
Provides context information accessible by models during simulation execution.
Models use this context to query the current simulation time or to schedule future events.
Required Methods§
Sourcefn current_tick(&self) -> SimTime
fn current_tick(&self) -> SimTime
Returns the current simulation tick (absolute time).
Sourcefn current_micro_step(&self) -> MicroStep
fn current_micro_step(&self) -> MicroStep
Returns the current micro-step (the index of the step within the current tick).
Sourcefn schedule_event(
&mut self,
delay: Duration,
priority: EventPriority,
event_payload: E,
)
fn schedule_event( &mut self, delay: Duration, priority: EventPriority, event_payload: E, )
Schedules an event with the specified delay and priority.
§Arguments
delay- The time elapsed from the current simulation time.priority- The priority level of the event.event_payload- The data payload associated with the scheduled event.