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

    • btn_classifierType

      protected JButton btn_classifierType
  • 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_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