Skip to main content

schedule

Function schedule 

Source
pub fn schedule(
    profile: &PowerProfileDefinition,
    chosen: &[(Id, Id)],
) -> Result<Vec<SequenceWindow>, ResolveError>
Expand description

When each chosen sequence may run, given that containers run in the order the profile lists them.

S2J messages/PPBC.PowerProfileDefinition.power_sequences_containers: “PPBC.PowerSequenceContainers must be placed in chronological order.” A container has no timestamp, so that is an interpretation rather than a checkable rule: container 0’s chosen sequence runs, then container 1’s, all inside start_time .. end_time. The latest a sequence may start is therefore end_time minus everything still to come, not minus its own duration (D32).

max_pause_before is carried on each window but not folded into it: it bounds the gap between two starts, so it can only reject a schedule. starts_are_feasible applies it.

chosen names one sequence per container, in the order the profile lists the containers; every container must appear exactly once. A list that skips, repeats or reorders a container is ResolveError::WrongContainer rather than a schedule for a profile nobody published.