java.lang.Object
unifeat.featureSelection.wrapper.PSOBasedMethods.BasicParticle<Double,Double>
unifeat.featureSelection.wrapper.PSOBasedMethods.PSO42.Particle

public class Particle extends BasicParticle<Double,Double>
This java class is used to represent a particle in particle swarm optimization version 4-2(PSO(4-2)) method in which the type of position and velocity vectors are double.
Author:
Sina Tabakhi
See Also:
  • Field Details

    • THETA

      public static double THETA
  • Constructor Details

    • Particle

      public Particle(int dimension)
      Initializes the parameters
      Parameters:
      dimension - the dimension of problem which equals to total number of features in the dataset
  • Method Details

    • numSelectedFeatures

      public int numSelectedFeatures()
      This method returns the number of selected features by the particle based on position vector.
      Specified by:
      numSelectedFeatures in class BasicParticle<Double,Double>
      Returns:
      number of selected features by the particle
    • numSelectedFeatures

      public static int numSelectedFeatures(Double[] position)
      This method returns the number of selected features by the particle based on personal best position vector.
      Parameters:
      position - the position vector of particle
      Returns:
      number of selected features by the particle
    • selectedFeaturesSubset

      public int[] selectedFeaturesSubset()
      This method returns the indices of selected features by the particle based on position vector.
      Specified by:
      selectedFeaturesSubset in class BasicParticle<Double,Double>
      Returns:
      the array of indices of the selected features by the particle