//******************* // network management //******************* boolean network_ref(int i, int j_int, int j_bit){ return (network_ints[i][j_int] & bitwise_filters[j_bit]) != 0; } void updateNet(){ //... check network for next visited links for(int u = 0 ; u < led_count; u++){ if(!visited[u]){ // see if it should be updated // check the network for linked members int c = 0; for(int c_int = 0; c_int < 10; c_int++){ for(int c_bit = 0; c_bit < 15; c_bit++){ //if they are connected, and the one to check is on, turn this one on if(network_ref(u, c_int, c_bit) && on[c]){ on_next[u] = true; visited_next[u] = true; } c++; } } } } // turn the current ones off for(int i = 0; i < led_count; i++){ if(on[i]) on_next[i] = false; } // time step for(int i = 0; i < led_count; i++){ on[i] = on_next[i]; visited[i] = visited_next[i]; } for(int i = 0; i < led_count; i++){ on[i] = on_next[i]; visited[i] = visited_next[i]; } } boolean allHaveBeenVisited(){ boolean toReturn = true; for(int i = 0; i < led_count; i++){ if(!visited[i]){ toReturn = false; break; } } return toReturn; }