fn weight_sequenced_tasks(
    sequenced_tasks: &SequencedSwanlingTasks,
    u: usize,
) -> BTreeMap<usize, Vec<Vec<usize>>> {
    // Build a sequenced BTreeMap containing weighted vectors of SwanlingTasks.
    let mut available_sequenced_tasks = BTreeMap::new();
    // Step through sequences, each containing a bucket of all SwanlingTasks with the same
    // sequence value, allowing actual weighting to be done by weight_unsequenced_tasks().
    for (sequence, unsequenced_tasks) in sequenced_tasks.iter() {
        let (weighted_tasks, _total_weighted_tasks) =
            weight_unsequenced_tasks(&unsequenced_tasks, u);
        available_sequenced_tasks.insert(*sequence, weighted_tasks);
    }

    available_sequenced_tasks
}
/// Build a weighted vector of vectors of sequenced SwanlingTasks.
Build a weighted vector of vectors of sequenced SwanlingTasks.
Build a weighted vector of vectors of sequenced SwanlingTasks .
fn weight_sequenced_tasks(
    sequenced_tasks: &SequencedSwanlingTasks,
    u: usize,
) -> BTreeMap<usize, Vec<Vec<usize>>> {
    // Build a sequenced BTreeMap containing weighted vectors of SwanlingTasks.
    let mut available_sequenced_tasks = BTreeMap::new();
    // Step through sequences, each containing a bucket of all SwanlingTasks with the same
    // sequence value, allowing actual weighting to be done by weight_unsequenced_tasks().
    for (sequence, unsequenced_tasks) in sequenced_tasks.iter() {
        let (weighted_tasks, _total_weighted_tasks) =
            weight_unsequenced_tasks(&unsequenced_tasks, u);
        available_sequenced_tasks.insert(*sequence, weighted_tasks);
    }
    available_sequenced_tasks
}
fn weight_sequenced_tasks ( sequenced_tasks : & SequencedSwanlingTasks , u : usize , ) -> BTreeMap < usize , Vec < Vec < usize > > > { // Build a sequenced BTreeMap containing weighted vectors of SwanlingTasks. let mut available_sequenced_tasks = BTreeMap :: new ( ) ; // Step through sequences, each containing a bucket of all SwanlingTasks with the same // sequence value, allowing actual weighting to be done by weight_unsequenced_tasks(). for ( sequence , unsequenced_tasks ) in sequenced_tasks . iter ( ) { let ( weighted_tasks , _total_weighted_tasks ) = weight_unsequenced_tasks ( & unsequenced_tasks , u ) ; available_sequenced_tasks . insert ( * sequence , weighted_tasks ) ; } available_sequenced_tasks }
Build a weighted vector of vectors of sequenced SwanlingTasks.
Build a weighted vector of vectors of sequenced SwanlingTasks .
sequenced_tasks
&SequencedSwanlingTasks
u
usize