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.AccessibleJDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class unifeat.gui.ParameterPanel
btn_more, btn_ok, lbl_about, lbl_title, moreOptionDescription, panel_about
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
The listener method for receiving action events.protected void
This method sets an action for the btn_ok button.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 valuesvoid
enablePositionValues
(boolean enable) Enables the values of text boxdouble
getC1()
This method returns the c1 value.double
getC2()
This method returns the c2 value.This method returns the selected classifier type.double
This method returns the position interval end value.double
This method returns the inertia weight (w) value.int
This method returns the k folds value.double
This method returns the velocity interval end value.double
This method returns the velocity interval start value.int
This method returns the number of iterations value.int
This method returns the size of population value.This method returns the selected classifier panel value.double
This method returns the position interval start value.void
The listener method for receiving item events.void
The listener method for receiving keyboard events (keystrokes).void
setC1
(double c1) This method sets the c1 value.void
setC2
(double c2) This method sets the c2 value.void
setClassifierType
(ClassifierType classifierType) This method sets the selected classifier type.void
Sets the default values of the basic PSO parametersvoid
setEndPosInterval
(double endPosInterval) This method sets the position interval end value.void
setInertiaWeight
(double inertiaWeight) This method sets the inertia weight (w) value.void
setKFolds
(int kFolds) This method sets the k folds value.void
setMaxVelocity
(double maxVelocity) This method sets the velocity interval end value.void
setMinVelocity
(double minVelocity) This method sets the velocity interval start value.void
setNumIteration
(int numIteration) This method sets the number of iterations value.void
setPopulationSize
(int populationSize) This method sets the size of population value.void
setSelectedClassifierPan
(Object selectedClassifierPan) This method sets the selected classifier panel value.void
setStartPosInterval
(double startPosInterval) This method sets the position interval start value.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 userMethods inherited from class unifeat.gui.ParameterPanel
btn_moreActionPerformed, getMoreOptionDescription, keyPressed, keyTyped, setMethodDescription, setMethodDescriptionPosition, setMethodTitle, setMethodTitlePosition, setMoreButtonPosition, setMoreOptionDescription, setOkButtonPosition, setPanelSize, setPanelTitle
Methods 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, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
Methods 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, toFront
Methods 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, validateTree
Methods 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
-
btn_classifierType
-
-
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:
keyReleased
in interfaceKeyListener
- Specified by:
keyReleased
in classParameterPanel
- Parameters:
e
- an action event
-
actionPerformed
The listener method for receiving action events. Invoked when an action occurs.- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in 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:
itemStateChanged
in interfaceItemListener
- Parameters:
e
- an action event
-
btn_okActionPerformed
This method sets an action for the btn_ok button.- Overrides:
btn_okActionPerformed
in classParameterPanel
- Parameters:
e
- an action event
-
getClassifierType
This method returns the selected classifier type.- Returns:
- the
classifierType
parameter
-
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
selectedClassifierPan
parameter
-
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
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 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
-