Class RandomInitialization

java.lang.Object
org.moeaframework.core.initialization.RandomInitialization
All Implemented Interfaces:
Initialization
Direct Known Subclasses:
InjectedInitialization

public class RandomInitialization extends Object implements Initialization
Initializes all built-in decision variables randomly. This invokes Variable.randomize() on each decision variable.
  • Field Details

    • problem

      protected final Problem problem
      The problem.
  • Constructor Details

    • RandomInitialization

      public RandomInitialization(Problem problem)
      Constructs a random initialization operator.
      Parameters:
      problem - the problem
  • Method Details

    • initialize

      public Solution[] initialize(int populationSize)
      Description copied from interface: Initialization
      Returns an array of solutions to become the initial population.
      Specified by:
      initialize in interface Initialization
      Parameters:
      populationSize - the number of solutions to create and initialize
      Returns:
      an array of the initial solutions