private double calNocturnas(int h1, int m1, double h) {
        int horaEnt = h1;
        double minutoEnt = m1;
        double nocturnas;
        double horas = h;
        double ent = horaEnt + (minutoEnt / 60);

        if (ent <= 6) {
            nocturnas = (6 - ent);
            if (nocturnas > horas) {
                nocturnas = horas;
            }
        } else if (ent > 22) {
            nocturnas = horas;
        } else {
            nocturnas = horas - (Math.abs(22 - ent));

        }

        if (nocturnas > 8) {
            nocturnas = 8;
        } else if (nocturnas < 0) {
            nocturnas = 0;
        }
        return nocturnas;
    }