public void calculateState(){
    
    boolean[] arr = new boolean[numNodes];
    int tempState=0;
    
    for(int i=0;i<numNodes;i++){
      arr[i] = nodes.get(i).getState();
    }
    
    for(int i=0;i<numNodes;i++){
      tempState = tempState << 1;
      tempState += (arr[i]? 1:0);
    }
    state = tempState;
    
  }