public void trainByWholePool(Instance inst, int windowSize) {
        int instsInitSize = 0;
        int instsSecondarySize = 0;

        if (Insts == null) {
            ArrayList attList = Collections.list(inst.enumerateAttributes());
            attList.add(inst.attribute(inst.classIndex()));
            Insts = new Instances("instancePool", attList, windowSize);
            Insts.setClassIndex(attList.size() - 1);
            Insts.add(inst);
        } else {
            Insts.add(inst);
        }
        if (Insts.size() >= windowSize && checkSize) {
            ClusterTrainingDataHarvester ctdh = new ClusterTrainingDataHarvester(this.ensemble.length);
            Instances[] insts = ctdh.getEnsembleTrainingData(Insts, Insts.numClasses());
            for (int i = 0; i < this.ensemble.length; i++) {
                instsInitSize = insts[i].size();
                //Train all of them with the current classifier's cluster
                for (int j = 0; j < instsInitSize; j++) {
                    updateError(insts[i].get(j), i);
                    this.ensemble[i].trainOnInstance(insts[i].get(j));
                }
                //If it is not the last cluster
                if (i != (insts.length - 1)) {
                    instsSecondarySize = insts[i + 1].size();
                    for (int j = 0; j < instsSecondarySize; j++) {
                        updateError(insts[i + 1].get(j), i);
                        this.ensemble[i].trainOnInstance(insts[i + 1].get(j));
                    }
                } else {
                    //If it is the last ensemble
                    int currentEnsemble = (int) (System.nanoTime() % (insts.length - 1));
                    instsSecondarySize = insts[currentEnsemble].size();
                    for (int j = 0; j < instsSecondarySize; j++) {
                        updateError(insts[currentEnsemble].get(j), i);
                        this.ensemble[i].trainOnInstance(insts[currentEnsemble].get(j));
                    }
                }
            }
            Insts.clear();
        }
    }