pub fn create_transition_map<'a>(
        ts: &'a [Transition], specs: &'a [TransitionSpec]
    ) -> Vec<Vec<&'a Transition>> {
        let mut temp_xs: Vec<(Vec<&SPPath>, Vec<&Transition>)> = specs
            .iter()
            .map(|s| {
                let x: Vec<&SPPath> = s.syncronized_with.iter().collect();
                (x, vec![&s.spec_transition])
            })
            .collect();
        for t in ts
            .iter()
        {
            let mut found = false;
            for (paths, ref mut transitions) in temp_xs.iter_mut() {
                if paths.contains(&t.path()) {
                    transitions.push(t);
                    found = true;
                }
            }
            if !found {
                temp_xs.push((vec![], vec![t]));
            }
        }
        temp_xs.into_iter().map(|(_, xs)| xs).collect()
    }
/// This function takes the specs and create a transition map so that the specs are syncronized
/// with the correct transitions. This is used internally to simplify the runner before each tick. A spec is often generated
/// by the planner or optimizer
This function takes the specs and create a transition map so that the specs are syncronized
with the correct transitions. This is used internally to simplify the runner before each tick. A spec is often generated
by the planner or optimizer
This function takes the specs and create a transition map so that the specs are syncronized with the correct transitions . This is used internally to simplify the runner before each tick . A spec is often generated by the planner or optimizer
pub fn create_transition_map<'a>(
        ts: &'a [Transition], specs: &'a [TransitionSpec]
    ) -> Vec<Vec<&'a Transition>> {
        let mut temp_xs: Vec<(Vec<&SPPath>, Vec<&Transition>)> = specs
            .iter()
            .map(|s| {
                let x: Vec<&SPPath> = s.syncronized_with.iter().collect();
                (x, vec![&s.spec_transition])
            })
            .collect();
        for t in ts
            .iter()
        {
            let mut found = false;
            for (paths, ref mut transitions) in temp_xs.iter_mut() {
                if paths.contains(&t.path()) {
                    transitions.push(t);
                    found = true;
                }
            }
            if !found {
                temp_xs.push((vec![], vec![t]));
            }
        }
        temp_xs.into_iter().map(|(_, xs)| xs).collect()
    }
pub fn create_transition_map < ' a > ( ts : & ' a [ Transition ] , specs : & ' a [ TransitionSpec ] ) -> Vec < Vec < & ' a Transition > > { let mut temp_xs : Vec < ( Vec < & SPPath > , Vec < & Transition > ) > = specs . iter ( ) . map ( | s | { let x : Vec < & SPPath > = s . syncronized_with . iter ( ) . collect ( ) ; ( x , vec ! [ s spec_transition ] ) } ) . collect ( ) ; for t in ts . iter ( ) { let mut found = false ; for ( paths , ref mut transitions ) in temp_xs . iter_mut ( ) { if paths . contains ( & t . path ( ) ) { transitions . push ( t ) ; found = true ; } } if ! found { temp_xs . push ( ( vec ! [ ] , vec ! [ t ] ) ) ; } } temp_xs . into_iter ( ) . map ( | ( _ , xs ) | xs ) . collect ( ) }
This function takes the specs and create a transition map so that the specs are syncronized
with the correct transitions.
This function takes the specs and create a transition map so that the specs are syncronized with the correct transitions .
ts
&'a [Transition]
specs
&'a [TransitionSpec]