Class Population

java.lang.Object
com.adriangarcia.metaheuristics.tsmbfoa.Population
Direct Known Subclasses:
Configurator

public class Population extends Object
Population class is the initial process of the TS-MBFOA, where the initial random population is created based on uniform distribution and using the NumberRandom class. This class also has the mechanism to sort the solution space for the CNOP based on feasibility rules.
Version:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor method that instantiates an object of the NumberRandom class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[][]
    Method that returns a matrix; the number of columns represents the number of CNOP variables to be solved.
    Method that returns a description of the population of each run.
    int
    Method returns the stored value for the sb parameter of the TS-MBFOA.
    double
    Method returns the stored value for the stepSize parameter of the TS-MBFOA.
    void
    setBacteriumMatix(double[][] bacteriumMatix)
    With this method the CNOP solution matrix can assigned.
    void
    setSb(int sb)
    Method to assign the number of bacteria in the population.
    The number of the population is determined between [10, 500].
    void
    setStepSize(double stepSize)
    Method that assigns value to the (R) parameter of the TS-MBFOA.
    Static step size [0,1].
    protected void
    sortPopulation(int numberVariables)
    This method uses an ordering technique based on feasibility rules.
    protected double[][]
    Method that takes care of starting the population of bacteria with size Sb X number of variables.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Population

      public Population()
      Constructor method that instantiates an object of the NumberRandom class.
  • Method Details

    • startPopulation

      protected double[][] startPopulation(Problem problem)
      Method that takes care of starting the population of bacteria with size Sb X number of variables.
      Parameters:
      problem - object of the class Problem
      Returns:
      Matrix representing the solution space for the CNOP.
    • sortPopulation

      protected void sortPopulation(int numberVariables)
      This method uses an ordering technique based on feasibility rules.
      Parameters:
      numberVariables - of CNOP design variables
    • getDescription

      public String getDescription()
      Method that returns a description of the population of each run.
      Returns:
      value String

      The invocation is as follows:


      object.getDescription();
    • getBacteriumMatix

      public double[][] getBacteriumMatix()
      Method that returns a matrix; the number of columns represents the number of CNOP variables to be solved. The number of rows represents the number of assigned Sb bacteria, which is a matrix of all the solutions for that CNOP.
      Returns:
      the bacteriumMatix
    • setBacteriumMatix

      public void setBacteriumMatix(double[][] bacteriumMatix)
      With this method the CNOP solution matrix can assigned. Commonly used to replace a solution space by a more optimal one.
      Parameters:
      bacteriumMatix - the bacteriumMatix to set
    • getSb

      public int getSb()
      Method returns the stored value for the sb parameter of the TS-MBFOA.
      Returns:
      value of parameter Sb
    • setSb

      public void setSb(int sb)
      Method to assign the number of bacteria in the population.
      The number of the population is determined between [10, 500].
      Parameters:
      sb - the sb to set
    • getStepSize

      public double getStepSize()
      Method returns the stored value for the stepSize parameter of the TS-MBFOA.
      Returns:
      value of parameter stepSize (R)
    • setStepSize

      public void setStepSize(double stepSize)
      Method that assigns value to the (R) parameter of the TS-MBFOA.
      Static step size [0,1].
      Parameters:
      stepSize - the stepSize to set