pub struct SchedulingContext {
pub current_time_ms: i64,
pub remaining_work: HashMap<String, i64>,
pub next_queue_length: HashMap<String, usize>,
pub resource_utilization: HashMap<String, f64>,
pub arrival_times: HashMap<String, i64>,
pub average_processing_time: Option<f64>,
}Expand description
Runtime scheduling state passed to dispatching rules.
Contains the current simulation clock, remaining work estimates, resource utilization, and arrival times needed by context-aware rules.
All times are in milliseconds relative to the scheduling epoch (t=0).
Fields§
§current_time_ms: i64Current simulation time (ms).
remaining_work: HashMap<String, i64>Remaining processing work per task (task_id → ms).
next_queue_length: HashMap<String, usize>Queue length at next resource per task.
resource_utilization: HashMap<String, f64>Current resource utilization (resource_id → 0.0..1.0).
arrival_times: HashMap<String, i64>Task arrival times (task_id → ms).
average_processing_time: Option<f64>Average processing time across all tasks (for ATC normalization).
Implementations§
Source§impl SchedulingContext
impl SchedulingContext
Sourcepub fn with_remaining_work(self, task_id: impl Into<String>, ms: i64) -> Self
pub fn with_remaining_work(self, task_id: impl Into<String>, ms: i64) -> Self
Sets remaining work for a task.
Sourcepub fn with_next_queue(self, task_id: impl Into<String>, length: usize) -> Self
pub fn with_next_queue(self, task_id: impl Into<String>, length: usize) -> Self
Sets queue length for a task.
Sourcepub fn with_utilization(self, resource_id: impl Into<String>, load: f64) -> Self
pub fn with_utilization(self, resource_id: impl Into<String>, load: f64) -> Self
Sets resource utilization.
Sourcepub fn with_arrival_time(self, task_id: impl Into<String>, time_ms: i64) -> Self
pub fn with_arrival_time(self, task_id: impl Into<String>, time_ms: i64) -> Self
Sets arrival time for a task.
Sourcepub fn with_average_processing_time(self, avg_ms: f64) -> Self
pub fn with_average_processing_time(self, avg_ms: f64) -> Self
Sets the average processing time.
Trait Implementations§
Source§impl Clone for SchedulingContext
impl Clone for SchedulingContext
Source§fn clone(&self) -> SchedulingContext
fn clone(&self) -> SchedulingContext
Returns a duplicate 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 SchedulingContext
impl Debug for SchedulingContext
Source§impl Default for SchedulingContext
impl Default for SchedulingContext
Source§fn default() -> SchedulingContext
fn default() -> SchedulingContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SchedulingContext
impl RefUnwindSafe for SchedulingContext
impl Send for SchedulingContext
impl Sync for SchedulingContext
impl Unpin for SchedulingContext
impl UnsafeUnpin for SchedulingContext
impl UnwindSafe for SchedulingContext
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