docs: protected void getBatch(int batchSize){
  
  //      if (numCalls == 0) {
  //        for (int i = 0; i < 1538*\15; i++) {
  //          randGenerator.nextInt(this.dataDimension());
  //        }
  //      }
  //      numCalls++;
  
      if (thisBatch == null || thisBatch.length != batchSize){
        thisBatch = new int[batchSize];
      }
  
      //-----------------------------
      //RANDOM WITH REPLACEMENT
      //-----------------------------
      if (sampleMethod.equals(SamplingMethod.RandomWithReplacement)){
        for(int i = 0; i<batchSize;i++){
          thisBatch[i] = randGenerator.nextInt(this.dataDimension());        //Just generate a random index
  //        System.err.println("numCalls = "+(numCalls++));
        }
        //-----------------------------
        //ORDERED
        //-----------------------------
      }else if(sampleMethod.equals(SamplingMethod.Ordered)){
        for(int i = 0; i<batchSize;i++){
          thisBatch[i] = (curElement + i) % this.dataDimension() ;          //Take the next batchSize points in order
        }
        curElement = (curElement + batchSize) % this.dataDimension();       //watch out for overflow
  
        //-----------------------------
        //RANDOM WITHOUT REPLACEMENT
        //-----------------------------
      }else if(sampleMethod.equals(SamplingMethod.RandomWithoutReplacement)){
        //Declare the indices array if needed.
        if (allIndices == null || allIndices.size()!= this.dataDimension()){
  
          allIndices = new ArrayList<Integer>();
          for(int i=0;i<this.dataDimension();i++){
            allIndices.add(i);
          }
          Collections.shuffle(allIndices,randGenerator);
        }
  
        for(int i = 0; i<batchSize;i++){
          thisBatch[i] = allIndices.get((curElement + i) % allIndices.size());  //Grab the next batchSize indices
        }
  
        if (curElement + batchSize > this.dataDimension()){
          Collections.shuffle(Arrays.asList(allIndices),randGenerator);                   //Shuffle if we got to the end of the list
        }
  
        //watch out for overflow
        curElement = (curElement + batchSize) % allIndices.size();          //Rollover
  
  
      }else{
        System.err.println("NO SAMPLING METHOD SELECTED");
        System.exit(1);
      }
  
  
    }