Class BasicACOPanel

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

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

    • btn_classifierType

      protected JButton btn_classifierType
  • Constructor Details

    • BasicACOPanel

      public BasicACOPanel()
      Creates new form BasicACOPanel. 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
    • 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
    • getColonySize

      public int getColonySize()
      This method returns the size of colony value.
      Returns:
      the colonySize parameter
    • setColonySize

      public void setColonySize(int colonySize)
      This method sets the size of colony value.
      Parameters:
      colonySize - the size of colony value
    • getAlpha

      public double getAlpha()
      This method returns the alpha.
      Returns:
      the alpha parameter
    • setAlpha

      public void setAlpha(double alpha)
      This method sets the alpha value.
      Parameters:
      alpha - the alpha value
    • getBeta

      public double getBeta()
      This method returns the beta value.
      Returns:
      the beta parameter
    • setBeta

      public void setBeta(double beta)
      This method sets the beta value.
      Parameters:
      beta - the beta value
    • getEvRate

      public double getEvRate()
      This method returns the evaporation rate.
      Returns:
      the evaporation rate parameter
    • setEvRate

      public void setEvRate(double evRate)
      This method sets the evaporation rate value.
      Parameters:
      evRate - the evaporation 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 ACO parameters
    • changeDefaultValue

      public void changeDefaultValue(int numIteration, int colonySize, double alpha, double beta, double evRate, int kFolds)
      Replaces the default values of basic ACO parameters with user values
      Parameters:
      numIteration - the maximum number of allowed iterations that algorithm repeated
      colonySize - the size of colony of candidate solutions
      alpha - the alpha parameter in the state transition rule that shows the relative importance of the pheromone
      beta - the beta parameter in the state transition rule that shows the relative importance of heuristic information
      evRate - the evaporation rate of the pheromone
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation
    • setUserValue

      public void setUserValue(ClassifierType classifierType, Object selectedClassifierPan, int numIteration, int colonySize, double alpha, double beta, double evRate, int kFolds)
      Sets the last values of the basic ACO parameters entered by user
      Parameters:
      classifierType - the selected classifier type
      selectedClassifierPan - the selected classifier panel
      numIteration - the maximum number of allowed iterations that algorithm repeated
      colonySize - the size of colony of candidate solutions
      alpha - the alpha parameter in the state transition rule that shows the relative importance of the pheromone
      beta - the beta parameter in the state transition rule that shows the relative importance of heuristic information
      evRate - the evaporation rate of the pheromone
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation