void updateNet(){ //... check network for next visited links for(int u = 0 ; u < on.length; u++){ if(!visited[u]){ // see if it should be updated // check the toCheck array for linked members for(int c = 0; c < on.length; c++){ //if they arec connected, and the one to check is on, turn this one on if(network[c][u] && on[c]){ on_next[u] = true; visited_next[u] = true; } } } } // turn the current ones off for(int i = 0; i < on.length; i++){ if(on[i]) on_next[i] = false; } // time step for(int i = 0; i < on.length; i++){ on[i] = on_next[i]; visited[i] = visited_next[i]; } for(int i = 0; i < on.length; i++){ on[i] = on_next[i]; visited[i] = visited_next[i]; } } boolean allHaveBeenVisited(){ boolean toReturn = true; for(int i = 0; i < on.length; i++){ if(!visited[i]){ toReturn = false; break; } } return toReturn; }