/*
 * KnapSackPanel.java
 *
 * Created on March 8, 2006, 11:01 PM
 */

package cz.pcland.knapsack;

import cz.pcland.knapsack.ConventionalSolution;
import cz.pcland.ga.PopulationType;
import cz.pcland.ga.crossover.CrossoverOpearator;
import cz.pcland.ga.crossover.SimpleCrossover;
import cz.pcland.ga.crossover.UniformCrossover;
import cz.pcland.ga.crossover.twoPointCrossover;
import cz.pcland.ga.fitness.CorrectionAlgorithmFitness;
import cz.pcland.ga.fitness.Evaluator;
import cz.pcland.ga.fitness.PenalizationFitness;
import cz.pcland.gavisualization.*;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import cz.pcland.functions.lexan.*;
import cz.pcland.functions.nodes.*;
import cz.pcland.functions.syntax.*;
import cz.pcland.io.*;
/**
 *
 * @author  petr
 */
public class KnapSackPanel extends BaseProblemPanel {
    private ConventionalSolution cs = null;
    
    //Swing worker to compute conventional solution
    SwingWorker CSworker;
    
    //Knapsack object
    private KnapSack ks;
    
    public void  setKnapSack(KnapSack ks) {
        this.ks = ks;
    }
    
    /**
     * Available evaluators
     */
    public Evaluator[] getEvaluators(){
        Evaluator[] ret = {new CorrectionAlgorithmFitness(), new PenalizationFitness()};
        return ret;
    }
    
    public CrossoverOpearator[] getCrossoverOperators() {
        CrossoverOpearator[] ret = {new SimpleCrossover(), new twoPointCrossover(), new UniformCrossover()};
        return ret;
    }
    
    public void visualizeFitness() {
        this.panelVisualization = new GAVisualizationFitness(10,10, "Fitness");
        this.jTabbedPane1.setComponentAt(3, panelVisualization);
        this.pnlVisualization = panelVisualization;
       // panelVisualization.setGAConfig(this.GAConfig);
        panelVisualization.updateGraph(infoData);
    }
    
    public void visualizeRank() {
        this.panelVisualization = new GAVisualizationEvaluation(10,10, "Price of items in knapsack");
        this.jTabbedPane1.setComponentAt(3, panelVisualization);
        this.pnlVisualization = panelVisualization;
        //panelVisualization.setGAConfig(this.GAConfig);
        panelVisualization.updateGraph(infoData);
    }
    
    
    
    /**
     * Called whenever new population is created. That coresponds to button start pressed.
     */
    public void onInitBegin() {
        this.setStrLen(ks.totalItems());
    }
    
    public void onInitEnd() {
        
    }
    
    public void onDoWorkBegin() {
        
    }
    
    /**
     * Called whenever GA invoked. That coresponds to button start or step pressed.
     */
    public void onDoWorkRunBegin() {
        
    }
    
    /**
     * Called whenever GA ends.
     */
    public void onDoWorkEnd() {
        ks.setContent(this.gi.getBestString());
        updateKSItemsList();
    }
    
    
    public void onDoWorkStepsBegin() {
        
    }
    
    public void onProgress() {
        ks.setContent(this.gi.getBestString());
        updateKSItemsList();
        
    }
    
    public void finish(){}
    
    
    
    public Object run(boolean reset) {
        System.out.println("called KS run");
        initWorker(((BaseVisualization)this.pnlVisualization), this.listProgress, PopulationType.BINARY, reset, ks);
        return start(1);
    }
    
    
    /** Creates new form KnapSackPanel */
    public KnapSackPanel(MainApplet3 parent) {
        super(parent);
        initComponents();
        loadDefaultKnapSack();
        //this.lblKSCapacity.setText(String.valueOf(KnapSack.getCapacity()));
        Runnable doSetData = new Runnable() {
            public void run() {
                listProgress.setCellRenderer(new CustomListRender());
                listKnapSack.setCellRenderer(new ColoredJListRenderer());
                lblKSCapacity.setText(String.valueOf(ks.getCapacity()));
            }
        };
        SwingUtilities.invokeLater(doSetData);
        ks.pnl = this;
        
    }
    
    void loadDefaultKnapSack() {
        ks = new KnapSack(750);
        
        ks.addItem(82.8, 14.5);
        ks.addItem( 48.5, 50.6);
        ks.addItem( 84.6,54.9);
        ks.addItem(73.5,91.7 );
        ks.addItem(41.3,82.1 );
        ks.addItem(87.9, 55.0 );
        ks.addItem(39.9,34.3 );
        ks.addItem(75.9, 23.1 );
        ks.addItem(72.3, 79.6);
        ks.addItem(8.3, 66.4 );
        ks.addItem(12.4, 42.4 );
        ks.addItem(66.4, 91.5 );
        ks.addItem(80.4, 85.5 );
        ks.addItem(21.8, 27.9 );
        ks.addItem(10.3, 64.6 );
        ks.addItem(48.7, 76.1 );
        ks.addItem(53.9, 20.7 );
        ks.addItem(19.1, 22.4 );
        ks.addItem(98.5, 14.5 );
        ks.addItem(58.6, 44.7 );
        ks.addItem(25.8, 34.8 );
        ks.addItem(47.3, 96.9 );
        ks.addItem(12.6, 32.0 );
        ks.addItem(9.9, 60.9 );
        ks.addItem(57.0, 38.3 );
        ks.addItem(73.5, 95.8 );
        ks.addItem(17.8, 36.6 );
        ks.addItem( 66.2, 1.6);
        ks.addItem(68.5, 30.3 );
        ks.addItem(93.6, 34.1 );
        ks.addItem(3.1, 48.7 );
       /* ks.addItem(9, 11);
        ks.addItem(2, 13);
        ks.addItem(2, 3);
        ks.addItem(1, 42);
        ks.addItem(4, 36);
        ks.addItem(17, 19);
        ks.addItem(30, 7);
        ks.addItem(1, 14);
        ks.addItem(10, 17);
        ks.addItem(39, 12);
        ks.addItem(52, 39);
        ks.addItem(12, 41);
        ks.addItem(45, 43);
        ks.addItem(35, 26);
        ks.addItem(4, 1);
        ks.addItem(15, 35);
        ks.addItem(21, 21);
        ks.addItem(4, 40);
        ks.addItem(5, 19);
        ks.addItem(2, 7);
        ks.addItem(1, 14);
        ks.addItem(1, 11);
        ks.addItem(39, 13);
        ks.addItem(3, 10);
        ks.addItem(40, 11);
        ks.addItem(50, 43);
        ks.addItem(6, 51);
        ks.addItem(10, 9);
        ks.addItem(1, 35);
        ks.addItem(40, 21);
        ks.addItem(1, 40);*/
        
        this.updateKSItemsList();
        
    }
    
    
    void updateKSItemsList(){
        //  java.util.Collections.copy(dest) sort(ks.getItems());
        this.listKnapSack.setListData(ks.getItems());
        this.lblKSCapacity.setText(String.valueOf(ks.getCapacity()));
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        buttonGroup1 = new javax.swing.ButtonGroup();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        listProgress = new javax.swing.JList();
        //jScrollPane1.setViewportView(jList1);
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listKnapSack = new javax.swing.JList();
        jPanel1 = new javax.swing.JPanel();
        inputKSCapacity = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        btnAddObject = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        inputPrice = new javax.swing.JTextField();
        inputCapacity = new javax.swing.JTextField();
        lblKSCapacity = new javax.swing.JLabel();
        jButton4 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        progressCS = new javax.swing.JProgressBar();
        btnCSFind = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        lblCSResult = new javax.swing.JLabel();
        radioApproximate = new javax.swing.JRadioButton();
        radioNaive = new javax.swing.JRadioButton();
        lblCSTime = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        btnCSCancel = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        listConventional = new javax.swing.JList();
        jPanel5 = new javax.swing.JPanel();
        pnlVisualization = new GAVisualizationEvaluation(15, 10, "Price of items in knapsack");

        setLayout(new java.awt.GridBagLayout());

        listProgress.setMaximumSize(new java.awt.Dimension(30000, 30050));
        jScrollPane1.setViewportView(listProgress);

        jTabbedPane1.addTab("Progress", jScrollPane1);

        jPanel3.setLayout(new java.awt.GridBagLayout());

        jScrollPane2.setAutoscrolls(true);
        jScrollPane2.setPreferredSize(new java.awt.Dimension(0, 0));
        jScrollPane2.setViewportView(listKnapSack);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        jPanel3.add(jScrollPane2, gridBagConstraints);

        jPanel1.setLayout(null);

        jPanel1.setMaximumSize(new java.awt.Dimension(32, 32));
        jPanel1.setPreferredSize(new java.awt.Dimension(175, 10));
        jPanel1.add(inputKSCapacity);
        inputKSCapacity.setBounds(110, 30, 40, 20);

        jLabel3.setText("New capacity:");
        jLabel3.setPreferredSize(new java.awt.Dimension(120, 14));
        jPanel1.add(jLabel3);
        jLabel3.setBounds(10, 30, 120, 14);

        jLabel2.setText("Current cap:");
        jLabel2.setPreferredSize(new java.awt.Dimension(120, 14));
        jPanel1.add(jLabel2);
        jLabel2.setBounds(10, 10, 120, 14);

        jButton1.setText("Set capacity");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jPanel1.add(jButton1);
        jButton1.setBounds(10, 50, 140, 24);

        jLabel1.setText("New item:");
        jLabel1.setPreferredSize(new java.awt.Dimension(120, 14));
        jPanel1.add(jLabel1);
        jLabel1.setBounds(10, 100, 120, 14);

        jButton3.setText("Add random items");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jPanel1.add(jButton3);
        jButton3.setBounds(10, 210, 150, 24);

        jLabel9.setText("Item capacity:");
        jLabel9.setPreferredSize(new java.awt.Dimension(120, 14));
        jPanel1.add(jLabel9);
        jLabel9.setBounds(10, 120, 120, 14);

        btnAddObject.setText("Add");
        btnAddObject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddObjectActionPerformed(evt);
            }
        });

        jPanel1.add(btnAddObject);
        btnAddObject.setBounds(10, 160, 140, 24);

        jLabel7.setText("Item price:");
        jLabel7.setPreferredSize(new java.awt.Dimension(120, 14));
        jPanel1.add(jLabel7);
        jLabel7.setBounds(10, 140, 120, 14);

        inputPrice.setMinimumSize(new java.awt.Dimension(40, 19));
        inputPrice.setPreferredSize(new java.awt.Dimension(40, 19));
        jPanel1.add(inputPrice);
        inputPrice.setBounds(110, 140, 40, 19);

        inputCapacity.setMinimumSize(new java.awt.Dimension(40, 19));
        inputCapacity.setPreferredSize(new java.awt.Dimension(40, 19));
        jPanel1.add(inputCapacity);
        inputCapacity.setBounds(110, 120, 40, 19);

        lblKSCapacity.setLabelFor(jButton2);
        jPanel1.add(lblKSCapacity);
        lblKSCapacity.setBounds(90, 7, 80, 20);

        jButton4.setText("Save to file");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jPanel1.add(jButton4);
        jButton4.setBounds(10, 270, 150, 24);

        jButton2.setText("Load from file");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jPanel1.add(jButton2);
        jButton2.setBounds(10, 300, 150, 24);

        jButton5.setText("Remove selected");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jPanel1.add(jButton5);
        jButton5.setBounds(10, 240, 150, 24);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel3.add(jPanel1, gridBagConstraints);

        jTabbedPane1.addTab(" Knapsak", jPanel3);

        jPanel4.setLayout(new java.awt.GridBagLayout());

        progressCS.setPreferredSize(new java.awt.Dimension(330, 14));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.gridwidth = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 5, 0);
        jPanel4.add(progressCS, gridBagConstraints);

        btnCSFind.setText("find");
        btnCSFind.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCSFindActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 0);
        jPanel4.add(btnCSFind, gridBagConstraints);

        jLabel8.setText("Result:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LAST_LINE_START;
        gridBagConstraints.insets = new java.awt.Insets(0, 15, 7, 0);
        jPanel4.add(jLabel8, gridBagConstraints);

        lblCSResult.setText("__");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.LAST_LINE_START;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 7, 0);
        jPanel4.add(lblCSResult, gridBagConstraints);

        buttonGroup1.add(radioApproximate);
        radioApproximate.setText(" Approximate solution");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 20, 0, 5);
        jPanel4.add(radioApproximate, gridBagConstraints);

        buttonGroup1.add(radioNaive);
        radioNaive.setSelected(true);
        radioNaive.setText(" Naive (all  possibilities)");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 20, 0, 0);
        jPanel4.add(radioNaive, gridBagConstraints);

        lblCSTime.setText("__");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 10, 4, 1);
        jPanel4.add(lblCSTime, gridBagConstraints);

        jLabel17.setText("Solution:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 10, 0, 0);
        jPanel4.add(jLabel17, gridBagConstraints);

        btnCSCancel.setText("Cancel");
        btnCSCancel.setEnabled(false);
        btnCSCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCSCancelActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0);
        jPanel4.add(btnCSCancel, gridBagConstraints);

        jScrollPane4.setViewportView(listConventional);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        jPanel4.add(jScrollPane4, gridBagConstraints);

        jTabbedPane1.addTab("Conventional solution", jPanel4);

        jPanel5.setLayout(new java.awt.BorderLayout());

        pnlVisualization.setLayout(new java.awt.GridBagLayout());

        jPanel5.add(pnlVisualization, java.awt.BorderLayout.CENTER);

        jTabbedPane1.addTab("Visualization", jPanel5);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridwidth = 6;
        gridBagConstraints.gridheight = 17;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        add(jTabbedPane1, gridBagConstraints);

    }// </editor-fold>//GEN-END:initComponents

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
        MyOptionPane.save(ks.saveToFile(),this, parent.jSplitPane1);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
        MyOptionPane.load(ks, this, parent.jSplitPane1);
        
    }//GEN-LAST:event_jButton2ActionPerformed
        
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// TODO add your handling code here:
        int[] selected = this.listKnapSack.getSelectedIndices();
        ks.cleanAllContent();
        for(int i=selected.length-1;i>=0;i--){
            ks.removeItem(selected[i]);
        }
        this.updateKSItemsList();
    }//GEN-LAST:event_jButton5ActionPerformed
    
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
        try {
            ks.setCapacity(Double.parseDouble(this.inputKSCapacity.getText()));
            this.lblKSCapacity.setText(String.valueOf(ks.getCapacity()));
        }catch(NumberFormatException e){
            JOptionPane.showMessageDialog(null,"error occured: " + e.toString(), "Input error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton1ActionPerformed
    
    private void btnCSCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCSCancelActionPerformed
// TODO add your handling code here:
        this.btnCSCancel.setEnabled(false);
        CSworker.interrupt();
        cs.updateStatus(0, "__");
    }//GEN-LAST:event_btnCSCancelActionPerformed
    
    private void btnCSFindActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCSFindActionPerformed
// TODO add your handling code here:
        cs = new ConventionalSolution(this.progressCS, this.lblCSResult, this.listConventional, this.lblCSTime, ks);
        if(this.radioNaive.isSelected()){
            
            this.btnCSFind.setEnabled(false);
            this.btnCSCancel.setEnabled(true);
            
            
            double possibilities = Math.pow(2, this.ks.totalItems());
            this.progressCS.setMaximum((int)possibilities);
            this.progressCS.setMinimum(0);
            
            CSworker = new SwingWorker() {
                public Object construct() {
                    return cs.doWork();
                }
                public void finished() {
                    btnCSFind.setEnabled(true);
                    btnCSCancel.setEnabled(false);
                    lblCSTime.setText(get().toString());
                }
            };
            CSworker.start();
        }else {
            cs.getApproximateSolution();
        }
    }//GEN-LAST:event_btnCSFindActionPerformed
    
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// TODO add your handling code here:
        String s = (String)JOptionPane.showInputDialog("Number of new items: ", new Integer(1));
        ks.cleanAllContent();
        int count = 0;
        if(s!=null)
            try {
                count = Integer.parseInt(s);
                
                ks.addRandom(count);
                
                updateKSItemsList();
                
            }catch(NumberFormatException e){
                JOptionPane.showMessageDialog(null,"error occured: " + e.toString(), "Input error", JOptionPane.ERROR_MESSAGE);
            }
    }//GEN-LAST:event_jButton3ActionPerformed
    
    private void btnAddObjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddObjectActionPerformed
// TODO add your handling code here:
        double capacity = 0;
        double price = 0;
        try{
            ks.cleanAllContent();
            capacity = Double.parseDouble(this.inputCapacity.getText());
            price =  Double.parseDouble(this.inputPrice.getText());
            ks.addItem(new KnapSackItem(price,capacity));
            updateKSItemsList();
        }catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(null,"error occured: " + e.toString(), "Input error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnAddObjectActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddObject;
    private javax.swing.JButton btnCSCancel;
    private javax.swing.JButton btnCSFind;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JTextField inputCapacity;
    private javax.swing.JTextField inputKSCapacity;
    private javax.swing.JTextField inputPrice;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblCSResult;
    private javax.swing.JLabel lblCSTime;
    private javax.swing.JLabel lblKSCapacity;
    private javax.swing.JList listConventional;
    private javax.swing.JList listKnapSack;
    private javax.swing.JList listProgress;
    private javax.swing.JPanel pnlVisualization;
    private javax.swing.JProgressBar progressCS;
    private javax.swing.JRadioButton radioApproximate;
    private javax.swing.JRadioButton radioNaive;
    // End of variables declaration//GEN-END:variables
    
}
