Class BasicGAPanel

All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
HGAFSPanel, SimpleGAPanel

public abstract class BasicGAPanel extends ParameterPanel implements ItemListener
This java class is used to create and show a panel for the parameter settings of the basic genetic algorithm (BasicGA) method.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • cb_classifierType

      JComboBox cb_classifierType
    • cb_selectionType

      JComboBox cb_selectionType
    • cb_crossoverType

      JComboBox cb_crossoverType
    • cb_mutationType

      JComboBox cb_mutationType
    • cb_replacementType

      JComboBox cb_replacementType
    • btn_classifierType

      protected JButton btn_classifierType
    • lbl_classifierType

      JLabel lbl_classifierType
    • lbl_selectionType

      JLabel lbl_selectionType
    • lbl_crossoverType

      JLabel lbl_crossoverType
    • lbl_mutationType

      JLabel lbl_mutationType
    • lbl_replacementType

      JLabel lbl_replacementType
    • lbl_numIteration

      JLabel lbl_numIteration
    • lbl_numIterationError

      JLabel lbl_numIterationError
    • lbl_populationSize

      JLabel lbl_populationSize
    • lbl_populationSizeError

      JLabel lbl_populationSizeError
    • lbl_crossoverRate

      JLabel lbl_crossoverRate
    • lbl_crossoverRateError

      JLabel lbl_crossoverRateError
    • lbl_mutationRate

      JLabel lbl_mutationRate
    • lbl_mutationRateError

      JLabel lbl_mutationRateError
    • lbl_kFolds

      JLabel lbl_kFolds
    • lbl_kFoldsError

      JLabel lbl_kFoldsError
    • txt_numIteration

      JTextField txt_numIteration
    • txt_populationSize

      JTextField txt_populationSize
    • txt_crossoverRate

      JTextField txt_crossoverRate
    • txt_mutationRate

      JTextField txt_mutationRate
    • txt_kFolds

      JTextField txt_kFolds
    • crossoverRate

      private double crossoverRate
    • mutationRate

      private double mutationRate
    • DEFAULT_CROSSOVER_RATE

      private static double DEFAULT_CROSSOVER_RATE
    • DEFAULT_MUTATION_RATE

      private static double DEFAULT_MUTATION_RATE
    • numIteration

      private int numIteration
    • populationSize

      private int populationSize
    • kFolds

      private int kFolds
    • DEFAULT_NUM_ITERATION

      private static int DEFAULT_NUM_ITERATION
    • DEFAULT_POPULATION_SIZE

      private static int DEFAULT_POPULATION_SIZE
    • DEFAULT_K_FOLDS

      private static int DEFAULT_K_FOLDS
    • classifierType

      private ClassifierType classifierType
    • DEFAULT_CLASSIFIER_TYPE

      private static final ClassifierType DEFAULT_CLASSIFIER_TYPE
    • selectionType

      private SelectionType selectionType
    • crossoverType

      private CrossOverType crossoverType
    • mutationType

      private MutationType mutationType
    • replacementType

      private ReplacementType replacementType
    • DEFAULT_SELECTION_TYPE

      private static SelectionType DEFAULT_SELECTION_TYPE
    • DEFAULT_CROSSOVER_TYPE

      private static CrossOverType DEFAULT_CROSSOVER_TYPE
    • DEFAULT_MUTATION_TYPE

      private static MutationType DEFAULT_MUTATION_TYPE
    • DEFAULT_REPLACEMENT_TYPE

      private static ReplacementType DEFAULT_REPLACEMENT_TYPE
    • svmEvaluationPanel

      private SVMClassifierPanel svmEvaluationPanel
    • dtEvaluationPanel

      private DTClassifierPanel dtEvaluationPanel
    • knnEvaluationPanel

      private KNNClassifierPanel knnEvaluationPanel
    • selectedClassifierPan

      private Object selectedClassifierPan
  • Constructor Details

    • BasicGAPanel

      public BasicGAPanel()
      Creates new form BasicGAPanel. This method is called from within the constructor to initialize the form.
  • Method Details

    • keyReleased

      public void keyReleased(KeyEvent e)
      The listener method for receiving keyboard events (keystrokes). Invoked when a key has been released.
      Specified by:
      keyReleased in interface KeyListener
      Specified by:
      keyReleased in class ParameterPanel
      Parameters:
      e - an action event
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      The listener method for receiving action events. Invoked when an action occurs.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class ParameterPanel
      Parameters:
      e - an action event
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      The listener method for receiving item events. Invoked when an item has been selected or deselected by the user.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      e - an action event
    • btn_moreOpClassifierActionPerformed

      private void btn_moreOpClassifierActionPerformed(ActionEvent e)
      This method sets an action for the btn_moreOpClassifier button.
      Parameters:
      e - an action event
    • cb_classifierItemStateChanged

      private void cb_classifierItemStateChanged(ItemEvent e)
      This method sets an action for the cb_classifier combo box.
      Parameters:
      e - an action event
    • cb_selectionTypeItemStateChanged

      private void cb_selectionTypeItemStateChanged(ItemEvent e)
      This method sets an action for the cb_selectionType combo box.
      Parameters:
      e - an action event
    • cb_crossoverTypeItemStateChanged

      private void cb_crossoverTypeItemStateChanged(ItemEvent e)
      This method sets an action for the cb_crossoverType combo box.
      Parameters:
      e - an action event
    • cb_mutationTypeItemStateChanged

      private void cb_mutationTypeItemStateChanged(ItemEvent e)
      This method sets an action for the cb_mutationType combo box.
      Parameters:
      e - an action event
    • cb_replacementTypeItemStateChanged

      private void cb_replacementTypeItemStateChanged(ItemEvent e)
      This method sets an action for the cb_replacementType combo box.
      Parameters:
      e - an action event
    • btn_okActionPerformed

      protected void btn_okActionPerformed(ActionEvent e)
      This method sets an action for the btn_ok button.
      Overrides:
      btn_okActionPerformed in class ParameterPanel
      Parameters:
      e - an action event
    • getClassifierType

      public ClassifierType getClassifierType()
      This method returns the selected classifier type.
      Returns:
      the classifierType parameter
    • setClassifierType

      public void setClassifierType(ClassifierType classifierType)
      This method sets the selected classifier type.
      Parameters:
      classifierType - the selected classifier type
    • getSelectedClassifierPan

      public Object getSelectedClassifierPan()
      This method returns the selected classifier panel value.
      Returns:
      the selectedClassifierPan parameter
    • setSelectedClassifierPan

      public void setSelectedClassifierPan(Object selectedClassifierPan)
      This method sets the selected classifier panel value.
      Parameters:
      selectedClassifierPan - the selected classifier panel value
    • getSelectionType

      public SelectionType getSelectionType()
      This method returns the selected selection type.
      Returns:
      the selectionType parameter
    • setSelectionType

      public void setSelectionType(SelectionType selectionType)
      This method sets the selected selection type.
      Parameters:
      selectionType - the selected selection type
    • getCrossOverType

      public CrossOverType getCrossOverType()
      This method returns the selected crossover type.
      Returns:
      the crossoverType parameter
    • setCrossOverType

      public void setCrossOverType(CrossOverType crossoverType)
      This method sets the selected crossover type.
      Parameters:
      crossoverType - the selected crossover type
    • getMutationType

      public MutationType getMutationType()
      This method returns the selected mutation type.
      Returns:
      the mutationType parameter
    • setMutationType

      public void setMutationType(MutationType mutationType)
      This method sets the selected mutation type.
      Parameters:
      mutationType - the selected mutation type
    • getReplacementType

      public ReplacementType getReplacementType()
      This method returns the selected replacement type.
      Returns:
      the replacementType parameter
    • setReplacementType

      public void setReplacementType(ReplacementType replacementType)
      This method sets the selected replacement type.
      Parameters:
      replacementType - the selected replacement type
    • getNumIteration

      public int getNumIteration()
      This method returns the number of iterations value.
      Returns:
      the numIteration parameter
    • setNumIteration

      public void setNumIteration(int numIteration)
      This method sets the number of iterations value.
      Parameters:
      numIteration - the number of iterations value
    • getPopulationSize

      public int getPopulationSize()
      This method returns the size of population value.
      Returns:
      the populationSize parameter
    • setPopulationSize

      public void setPopulationSize(int populationSize)
      This method sets the size of population value.
      Parameters:
      populationSize - the size of population value
    • getCrossoverRate

      public double getCrossoverRate()
      This method returns the crossover rate value.
      Returns:
      the crossoverRate parameter
    • setCrossoverRate

      public void setCrossoverRate(double crossoverRate)
      This method sets the crossover rate value.
      Parameters:
      crossoverRate - the crossover rate value
    • getMutationRate

      public double getMutationRate()
      This method returns the mutation rate value.
      Returns:
      the mutationRate parameter
    • setMutationRate

      public void setMutationRate(double mutationRate)
      This method sets the mutation rate value.
      Parameters:
      mutationRate - the mutation rate value
    • getKFolds

      public int getKFolds()
      This method returns the k folds value.
      Returns:
      the kFolds parameter
    • setKFolds

      public void setKFolds(int kFolds)
      This method sets the k folds value.
      Parameters:
      kFolds - the k folds value
    • setDefaultValue

      public void setDefaultValue()
      Sets the default values of the basic GA parameters
    • changeDefaultValue

      public void changeDefaultValue(SelectionType selectionType, CrossOverType crossoverType, MutationType mutationType, ReplacementType replacementType, int numIteration, int populationSize, double crossoverRate, double mutationRate, int kFolds)
      Replaces the default values of basic GA parameters with user values
      Parameters:
      selectionType - the selected selection type
      crossoverType - the selected crossover type
      mutationType - the selected mutation type
      replacementType - the selected replacement type
      numIteration - the maximum number of allowed iterations that algorithm repeated
      populationSize - the size of population of candidate solutions
      crossoverRate - the probability of crossover operation
      mutationRate - the probability of mutation operation
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation
    • setUserValue

      public void setUserValue(ClassifierType classifierType, Object selectedClassifierPan, SelectionType selectionType, CrossOverType crossoverType, MutationType mutationType, ReplacementType replacementType, int numIteration, int populationSize, double crossoverRate, double mutationRate, int kFolds)
      Sets the last values of the basic GA parameters entered by user
      Parameters:
      classifierType - the selected classifier type
      selectedClassifierPan - the selected classifier panel
      selectionType - the selected selection type
      crossoverType - the selected crossover type
      mutationType - the selected mutation type
      replacementType - the selected replacement type
      numIteration - the maximum number of allowed iterations that algorithm repeated
      populationSize - the size of population of candidate solutions
      crossoverRate - the probability of crossover operation
      mutationRate - the probability of mutation operation
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation