Class InjectedInitialization

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

public class InjectedInitialization extends RandomInitialization
Initialization method that injects pre-defined solutions into the initial population. This is typically used to initialize an algorithm with a set of known "good" solutions.
  • Constructor Details

    • InjectedInitialization

      public InjectedInitialization(Problem problem, Solution... injectedSolutions)
      Constructs a random initialization operator that includes one or more pre-defined solutions.
      Parameters:
      problem - the problem
      injectedSolutions - the pre-defined solutions injected into the initial population
    • InjectedInitialization

      public InjectedInitialization(Problem problem, List<Solution> injectedSolutions)
      Constructs a random initialization operator that includes one or more pre-defined solutions.
      Parameters:
      problem - the problem
      injectedSolutions - the pre-defined solutions injected into the initial population
  • 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
      Overrides:
      initialize in class RandomInitialization
      Parameters:
      populationSize - the number of solutions to create and initialize
      Returns:
      an array of the initial solutions