pub fn process(&mut self, inputs: &[&[f64]]) {
        assert!(self.incoming_signals.len() == self.graph.nodes().len());
        self.reset_signals();

        // assign all inputs
        let mut i = 0;
        for input_list in inputs.iter() {
            for &input in input_list.iter() {
                let input_idx = self.inputs[i];
                self.set_signal(input_idx, input);
                i += 1;
            }
        }
        assert!(i == self.inputs.len());

        self.nodes_bfs.clear();
        self.seen_bfs.clear();

        // start from all nodes which have zero in_degree()
        for &start_node_index in &self.start_nodes {
            self.nodes_bfs.push(start_node_index);
            self.seen_bfs.insert(start_node_index.index());
        }

        // propagate the signals starting from the nodes with zero in degree.
        self.propagate_signals();
    }
/// Process the network for the given `inputs`. Outputs can be read after this call using
/// `read_output`.
Process the network for the given `inputs`. Outputs can be read after this call using
`read_output`.
Process the network for the given ` inputs ` . Outputs can be read after this call using ` read_output ` .
pub fn process(&mut self, inputs: &[&[f64]]) {
        assert!(self.incoming_signals.len() == self.graph.nodes().len());
        self.reset_signals();
        // assign all inputs
        let mut i = 0;
        for input_list in inputs.iter() {
            for &input in input_list.iter() {
                let input_idx = self.inputs[i];
                self.set_signal(input_idx, input);
                i += 1;
            }
        }
        assert!(i == self.inputs.len());
        self.nodes_bfs.clear();
        self.seen_bfs.clear();
        // start from all nodes which have zero in_degree()
        for &start_node_index in &self.start_nodes {
            self.nodes_bfs.push(start_node_index);
            self.seen_bfs.insert(start_node_index.index());
        }
        // propagate the signals starting from the nodes with zero in degree.
        self.propagate_signals();
    }
pub fn process ( & mut self , inputs : & [ & [ f64 ] ] ) { assert ! ( self incoming_signals len ( ) self graph nodes ( ) len ( ) ) ; self . reset_signals ( ) ; // assign all inputs let mut i = 0 ; for input_list in inputs . iter ( ) { for & input in input_list . iter ( ) { let input_idx = self . inputs [ i ] ; self . set_signal ( input_idx , input ) ; i += 1 ; } } assert ! ( i self inputs len ( ) ) ; self . nodes_bfs . clear ( ) ; self . seen_bfs . clear ( ) ; // start from all nodes which have zero in_degree() for & start_node_index in & self . start_nodes { self . nodes_bfs . push ( start_node_index ) ; self . seen_bfs . insert ( start_node_index . index ( ) ) ; } // propagate the signals starting from the nodes with zero in degree. self . propagate_signals ( ) ; }
Process the network for the given `inputs`.
Process the network for the given ` inputs ` .
&mut self
inputs
&[&[f64]]
&mut self
inputs
&[&[f64]]