/*
 * 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 javaml;

import java.util.ArrayList;
import static javafx.scene.input.KeyCode.T;

/**
 *
 * @author u6033451
 */
public class JAVAML {

    ArrayList<double[]> dataSetX = new ArrayList<>();
    ArrayList<double[]> dataSetY = new ArrayList<>();

    public JAVAML() {
        this.geraDataSet();
    }
    
    

    @SuppressWarnings("empty-statement")
    public void geraDataSet() {
        // TODO code application logic here
        double diasemana = 0;
        for (int i = 0; i < 10000; i++) {
            if (diasemana == 7) {
                diasemana = 0;
            }
            double random = (int) (Math.random() * 1000 + 1);
            double random2 = (int) (Math.random() * 500 + 1);
            double perc = 0;
            double tempo = 0;
            double tempo2 = 0;

            if (random > random2) {
                perc = ((random2 * 100) / random);
            } else {
                perc = ((random * 100) / random2);
            }

            if (perc >= 75) {
                tempo = 1.5;
                tempo2 = 1.5;
            } else if (perc >= 50) {
                if (random > random2) {
                    tempo = 2.0;
                    tempo2 = 1.5;

                } else {
                    tempo2 = 2.0;
                    tempo = 1.5;
                }

            } else if (perc >= 25) {
                if (random > random2) {
                    tempo = 2.5;
                    tempo2 = 1.0;

                } else {
                    tempo2 = 2.5;
                    tempo = 1.0;
                }

            } else if (perc >= 0) {
                if (random > random2) {
                    tempo = 2.5;
                    tempo2 = 0.5;

                } else {
                    tempo2 = 2.5;
                    tempo = 0.5;
                }
            }

            dataSetX.add(new double[]{++diasemana, random, random2});
            dataSetY.add(new double[]{tempo, tempo2});

            System.out.println(diasemana+"\t"+random+"\t"+random2+"\t"+tempo+"\t"+tempo2);
        }
    }

    public double[][] getX() {
//        Double[][] x = new Double[dataSetX.size()][3];
//        x = dataSetX.toArray(x);
//        return x;

        double[][] x = new double[dataSetX.size()][3];
        x = dataSetX.toArray(x);                     
        return x;
    }

    public double[][] getY() {
         double[][] y = new double[dataSetY.size()][2];
        y = dataSetY.toArray(y);                     
        return y;
    }

}
