Class BasicPSOPanel
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
unifeat.gui.ParameterPanel
unifeat.gui.featureSelection.wrapper.PSOBased.BasicPSOPanel
- All Implemented Interfaces:
ActionListener,ItemListener,KeyListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
- Direct Known Subclasses:
BPSOPanel,CPSOPanel,HPSO_LSPanel,PSO42Panel
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButtonprivate doubleprivate double(package private) JComboBoxprivate ClassifierTypeprivate static doubleprivate static doubleprivate static final ClassifierTypeprivate static doubleprivate static doubleprivate static intprivate static doubleprivate static doubleprivate static intprivate static intprivate static doubleprivate DTClassifierPanelprivate doubleprivate doubleprivate intprivate KNNClassifierPanel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabelprivate doubleprivate doubleprivate intprivate intprivate Objectprivate doubleprivate SVMClassifierPanel(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextFieldFields inherited from class unifeat.gui.ParameterPanel
btn_more, btn_ok, lbl_about, lbl_title, moreOptionDescription, panel_aboutFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe listener method for receiving action events.private voidThis method sets an action for the btn_moreOpClassifier button.protected voidThis method sets an action for the btn_ok button.private voidThis method sets an action for the cb_classifier combo box.voidchangeDefaultValue(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 valuesvoidenablePositionValues(boolean enable) Enables the values of text boxdoublegetC1()This method returns the c1 value.doublegetC2()This method returns the c2 value.This method returns the selected classifier type.doubleThis method returns the position interval end value.doubleThis method returns the inertia weight (w) value.intThis method returns the k folds value.doubleThis method returns the velocity interval end value.doubleThis method returns the velocity interval start value.intThis method returns the number of iterations value.intThis method returns the size of population value.This method returns the selected classifier panel value.doubleThis method returns the position interval start value.voidThe listener method for receiving item events.voidThe listener method for receiving keyboard events (keystrokes).voidsetC1(double c1) This method sets the c1 value.voidsetC2(double c2) This method sets the c2 value.voidsetClassifierType(ClassifierType classifierType) This method sets the selected classifier type.voidSets the default values of the basic PSO parametersvoidsetEndPosInterval(double endPosInterval) This method sets the position interval end value.voidsetInertiaWeight(double inertiaWeight) This method sets the inertia weight (w) value.voidsetKFolds(int kFolds) This method sets the k folds value.voidsetMaxVelocity(double maxVelocity) This method sets the velocity interval end value.voidsetMinVelocity(double minVelocity) This method sets the velocity interval start value.voidsetNumIteration(int numIteration) This method sets the number of iterations value.voidsetPopulationSize(int populationSize) This method sets the size of population value.voidsetSelectedClassifierPan(Object selectedClassifierPan) This method sets the selected classifier panel value.voidsetStartPosInterval(double startPosInterval) This method sets the position interval start value.voidsetUserValue(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 userMethods inherited from class unifeat.gui.ParameterPanel
btn_moreActionPerformed, getMoreOptionDescription, keyPressed, keyTyped, setMethodDescription, setMethodDescriptionPosition, setMethodTitle, setMethodTitlePosition, setMoreButtonPosition, setMoreOptionDescription, setOkButtonPosition, setPanelSize, setPanelTitleMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
cb_classifierType
JComboBox cb_classifierType -
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
-
DEFAULT_CLASSIFIER_TYPE
-
svmEvaluationPanel
-
dtEvaluationPanel
-
knnEvaluationPanel
-
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
The listener method for receiving keyboard events (keystrokes). Invoked when a key has been released.- Specified by:
keyReleasedin interfaceKeyListener- Specified by:
keyReleasedin classParameterPanel- Parameters:
e- an action event
-
actionPerformed
The listener method for receiving action events. Invoked when an action occurs.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classParameterPanel- Parameters:
e- an action event
-
itemStateChanged
The listener method for receiving item events. Invoked when an item has been selected or deselected by the user.- Specified by:
itemStateChangedin interfaceItemListener- Parameters:
e- an action event
-
btn_moreOpClassifierActionPerformed
This method sets an action for the btn_moreOpClassifier button.- Parameters:
e- an action event
-
cb_classifierItemStateChanged
This method sets an action for the cb_classifier combo box.- Parameters:
e- an action event
-
btn_okActionPerformed
This method sets an action for the btn_ok button.- Overrides:
btn_okActionPerformedin classParameterPanel- Parameters:
e- an action event
-
getClassifierType
This method returns the selected classifier type.- Returns:
- the
classifierTypeparameter
-
setClassifierType
This method sets the selected classifier type.- Parameters:
classifierType- the selected classifier type
-
getSelectedClassifierPan
This method returns the selected classifier panel value.- Returns:
- the
selectedClassifierPanparameter
-
setSelectedClassifierPan
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
numIterationparameter
-
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
populationSizeparameter
-
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
inertiaWeightparameter
-
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
c1parameter
-
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
c2parameter
-
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
startPosIntervalparameter
-
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
endPosIntervalparameter
-
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
minVelocityparameter
-
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
maxVelocityparameter
-
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
kFoldsparameter
-
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 repeatedpopulationSize- the size of population of candidate solutionsinertiaWeight- the inertia weight in the velocity updating rulec1- the acceleration constant in the velocity updating rulec2- the acceleration constant in the velocity updating rulestartPosInterval- the position interval start value of each particleendPosInterval- the position interval end value of each particleminVelocity- the velocity interval end value of each particlemaxVelocity- the velocity interval end value of each particlekFolds- 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 typeselectedClassifierPan- the selected classifier panelnumIteration- the maximum number of allowed iterations that algorithm repeatedpopulationSize- the size of population of candidate solutionsinertiaWeight- the inertia weight in the velocity updating rulec1- the acceleration constant in the velocity updating rulec2- the acceleration constant in the velocity updating rulestartPosInterval- the position interval start value of each particleendPosInterval- the position interval end value of each particleminVelocity- the velocity interval end value of each particlemaxVelocity- the velocity interval end value of each particlekFolds- the number of equal sized subsamples that is used in k-fold cross validation
-