private void algorithmButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_algorithmButtonActionPerformed
        try{
            double crossChance = Float.parseFloat(crossover.getText());
            double mutationChance = Float.parseFloat(mutation.getText());
            int populationNum = Integer.parseInt(population.getText());
            int generationsNum = Integer.parseInt(generations.getText());
            int fitnessProms = 0;
            if(0.0<crossChance && 0.0<mutationChance && crossChance<1.0 && mutationChance<1.0 && populationNum > 2){
                //Generate random population
                geneticPop.add(s);
                for(int i=1; i<populationNum; i++){
                    geneticPop.add(gc.generateRandomSchedule(2, 3, 5, 6));
                }
                geneticSol = gc.geneticAlgorithm(geneticPop, crossChance, mutationChance, generationsNum, populationNum);
                fitness.setText("" + geneticSol.get(0).getFitness());
                for(int i=0; i<geneticSol.size(); i++){
                    fitnessProms =+ geneticSol.get(i).getFitness();
                }
                fitnessProm.setText("" + fitnessProms);
                gc.changeText(geneticSol.get(floorList.getSelectedIndex()), sched, floorList.getSelectedIndex(), roomList.getSelectedIndex());
            }
            else{
                JOptionPane.showMessageDialog(this, "Valores de cruce y mutacion invalidos!",
                        "Error de entrada", JOptionPane.ERROR_MESSAGE);
            }
        } catch(Exception e){
            JOptionPane.showMessageDialog(this, "Debe ingresar valores de cruce, mutacion y generaciones!",
                        "Error de entrada", JOptionPane.ERROR_MESSAGE);
            System.out.println(e);
            crossover.setText("");
            mutation.setText("");
            population.setText("");
            generations.setText("");
        }
    }//GEN-LAST:event_algorithmButtonActionPerformed