ErrorEstimate.java [src/java/utils] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author sidereus
 */
public class ErrorEstimate {

    List<Permutation> pl = new ArrayList<>();
    int betweenQuartiles = 0;
    int betweenMinMax = 0;
    double quartPerc = 0.0;
    double minmaxPerc = 0.0;


    public void add(List<Double> vals, double exact) {
        pl.add(new Permutation(vals, exact));
    }


    public void compute() {
        int totPerm = pl.size();

        for (Permutation p : pl) {
            if (p.getQ()) {
                betweenQuartiles++;
                betweenMinMax++;
            } else if (p.getMM()) {
                betweenMinMax++;
            }
        }
        quartPerc = betweenQuartiles * 100 / totPerm;
        minmaxPerc = betweenMinMax * 100 / totPerm;
    }


    public double getMinMaxPerc() {
        return minmaxPerc;
    }


    public double getQuartilesPerc() {
        return quartPerc;
    }
   
}