Class BasicPSOPanel

All Implemented Interfaces:
ActionListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
BPSOPanel, CPSOPanel, HPSO_LSPanel, PSO42Panel

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

    • cb_classifierType

      JComboBox cb_classifierType
    • btn_classifierType

      protected JButton btn_classifierType
    • lbl_classifierType

      JLabel lbl_classifierType
    • lbl_numIteration

      JLabel lbl_numIteration
    • lbl_numIterationError

      JLabel lbl_numIterationError
    • lbl_populationSize

      JLabel lbl_populationSize
    • lbl_populationSizeError

      JLabel lbl_populationSizeError
    • lbl_inertiaWeight

      JLabel lbl_inertiaWeight
    • lbl_inertiaWeightError

      JLabel lbl_inertiaWeightError
    • lbl_c1

      JLabel lbl_c1
    • lbl_c1Error

      JLabel lbl_c1Error
    • lbl_c2

      JLabel lbl_c2
    • lbl_c2Error

      JLabel lbl_c2Error
    • lbl_posInterval

      JLabel lbl_posInterval
    • lbl_startPosInterval

      JLabel lbl_startPosInterval
    • lbl_startPosIntervalError

      JLabel lbl_startPosIntervalError
    • lbl_endPosInterval

      JLabel lbl_endPosInterval
    • lbl_endPosIntervalError

      JLabel lbl_endPosIntervalError
    • lbl_velocityInterval

      JLabel lbl_velocityInterval
    • lbl_minVelocity

      JLabel lbl_minVelocity
    • lbl_minVelocityError

      JLabel lbl_minVelocityError
    • lbl_maxVelocity

      JLabel lbl_maxVelocity
    • lbl_maxVelocityError

      JLabel lbl_maxVelocityError
    • lbl_kFolds

      JLabel lbl_kFolds
    • lbl_kFoldsError

      JLabel lbl_kFoldsError
    • txt_numIteration

      JTextField txt_numIteration
    • txt_populationSize

      JTextField txt_populationSize
    • txt_inertiaWeight

      JTextField txt_inertiaWeight
    • txt_c1

      JTextField txt_c1
    • txt_c2

      JTextField txt_c2
    • txt_startPosInterval

      JTextField txt_startPosInterval
    • txt_endPosInterval

      JTextField txt_endPosInterval
    • txt_minVelocity

      JTextField txt_minVelocity
    • txt_maxVelocity

      JTextField txt_maxVelocity
    • txt_kFolds

      JTextField txt_kFolds
    • inertiaWeight

      private double inertiaWeight
    • c1

      private double c1
    • c2

      private double c2
    • startPosInterval

      private double startPosInterval
    • endPosInterval

      private double endPosInterval
    • minVelocity

      private double minVelocity
    • maxVelocity

      private double maxVelocity
    • DEFAULT_INERTIA_WEIGHT

      private static double DEFAULT_INERTIA_WEIGHT
    • DEFAULT_C1

      private static double DEFAULT_C1
    • DEFAULT_C2

      private static double DEFAULT_C2
    • DEFAULT_START_POS_INTERVAL

      private static double DEFAULT_START_POS_INTERVAL
    • DEFAULT_END_POS_INTERVAL

      private static double DEFAULT_END_POS_INTERVAL
    • DEFAULT_MIN_VELOCITY

      private static double DEFAULT_MIN_VELOCITY
    • DEFAULT_MAX_VELOCITY

      private static double DEFAULT_MAX_VELOCITY
    • 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
    • svmEvaluationPanel

      private SVMClassifierPanel svmEvaluationPanel
    • dtEvaluationPanel

      private DTClassifierPanel dtEvaluationPanel
    • knnEvaluationPanel

      private KNNClassifierPanel knnEvaluationPanel
    • selectedClassifierPan

      private Object selectedClassifierPan
  • Constructor Details

    • BasicPSOPanel

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

      public double getInertiaWeight()
      This method returns the inertia weight (w) value.
      Returns:
      the inertiaWeight parameter
    • setInertiaWeight

      public void setInertiaWeight(double inertiaWeight)
      This method sets the inertia weight (w) value.
      Parameters:
      inertiaWeight - the inertia weight (w) value
    • getC1

      public double getC1()
      This method returns the c1 value.
      Returns:
      the c1 parameter
    • setC1

      public void setC1(double c1)
      This method sets the c1 value.
      Parameters:
      c1 - the c1 value
    • getC2

      public double getC2()
      This method returns the c2 value.
      Returns:
      the c2 parameter
    • setC2

      public void setC2(double c2)
      This method sets the c2 value.
      Parameters:
      c2 - the c2 value
    • getStartPosInterval

      public double getStartPosInterval()
      This method returns the position interval start value.
      Returns:
      the startPosInterval parameter
    • setStartPosInterval

      public void setStartPosInterval(double startPosInterval)
      This method sets the position interval start value.
      Parameters:
      startPosInterval - the position interval start value
    • getEndPosInterval

      public double getEndPosInterval()
      This method returns the position interval end value.
      Returns:
      the endPosInterval parameter
    • setEndPosInterval

      public void setEndPosInterval(double endPosInterval)
      This method sets the position interval end value.
      Parameters:
      endPosInterval - the position interval end value
    • getMinVelocity

      public double getMinVelocity()
      This method returns the velocity interval start value.
      Returns:
      the minVelocity parameter
    • setMinVelocity

      public void setMinVelocity(double minVelocity)
      This method sets the velocity interval start value.
      Parameters:
      minVelocity - the velocity interval start value
    • getMaxVelocity

      public double getMaxVelocity()
      This method returns the velocity interval end value.
      Returns:
      the maxVelocity parameter
    • setMaxVelocity

      public void setMaxVelocity(double maxVelocity)
      This method sets the velocity interval end value.
      Parameters:
      maxVelocity - the velocity interval end 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 PSO parameters
    • changeDefaultValue

      public void changeDefaultValue(int numIteration, int populationSize, double inertiaWeight, double c1, double c2, double startPosInterval, double endPosInterval, double minVelocity, double maxVelocity, int kFolds)
      Replaces the default values of basic PSO parameters with user values
      Parameters:
      numIteration - the maximum number of allowed iterations that algorithm repeated
      populationSize - the size of population of candidate solutions
      inertiaWeight - the inertia weight in the velocity updating rule
      c1 - the acceleration constant in the velocity updating rule
      c2 - the acceleration constant in the velocity updating rule
      startPosInterval - the position interval start value of each particle
      endPosInterval - the position interval end value of each particle
      minVelocity - the velocity interval end value of each particle
      maxVelocity - the velocity interval end value of each particle
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation
    • enablePositionValues

      public void enablePositionValues(boolean enable)
      Enables the values of text box
      Parameters:
      enable - the status of the value
    • setUserValue

      public void setUserValue(ClassifierType classifierType, Object selectedClassifierPan, int numIteration, int populationSize, double inertiaWeight, double c1, double c2, double startPosInterval, double endPosInterval, double minVelocity, double maxVelocity, int kFolds)
      Sets the last values of the basic PSO 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
      populationSize - the size of population of candidate solutions
      inertiaWeight - the inertia weight in the velocity updating rule
      c1 - the acceleration constant in the velocity updating rule
      c2 - the acceleration constant in the velocity updating rule
      startPosInterval - the position interval start value of each particle
      endPosInterval - the position interval end value of each particle
      minVelocity - the velocity interval end value of each particle
      maxVelocity - the velocity interval end value of each particle
      kFolds - the number of equal sized subsamples that is used in k-fold cross validation