Skip to main content

SchedulingContext

Struct SchedulingContext 

Source
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: i64

Current 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

Source

pub fn at_time(current_time_ms: i64) -> Self

Creates a context at the given time.

Source

pub fn with_remaining_work(self, task_id: impl Into<String>, ms: i64) -> Self

Sets remaining work for a task.

Source

pub fn with_next_queue(self, task_id: impl Into<String>, length: usize) -> Self

Sets queue length for a task.

Source

pub fn with_utilization(self, resource_id: impl Into<String>, load: f64) -> Self

Sets resource utilization.

Source

pub fn with_arrival_time(self, task_id: impl Into<String>, time_ms: i64) -> Self

Sets arrival time for a task.

Source

pub fn with_average_processing_time(self, avg_ms: f64) -> Self

Sets the average processing time.

Trait Implementations§

Source§

impl Clone for SchedulingContext

Source§

fn clone(&self) -> SchedulingContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchedulingContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SchedulingContext

Source§

fn default() -> SchedulingContext

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V