MOEA Framework 2.12
API Specification

org.moeaframework.core.operator
Class RandomInitialization

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

public class RandomInitialization
extends Object
implements Initialization

Initializes all built-in decision variables randomly. The initialize(Variable) method can be extended to provide support for other types.


Field Summary
protected  int populationSize
          The initial population size.
protected  Problem problem
          The problem.
 
Constructor Summary
RandomInitialization(Problem problem, int populationSize)
          Constructs a random initialization operator.
 
Method Summary
 Solution[] initialize()
          Returns an array of solutions to become the initial population.
protected  void initialize(Variable variable)
          Deprecated. Call variable.randomize() instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

problem

protected final Problem problem
The problem.


populationSize

protected final int populationSize
The initial population size.

Constructor Detail

RandomInitialization

public RandomInitialization(Problem problem,
                            int populationSize)
Constructs a random initialization operator.

Parameters:
problem - the problem
populationSize - the initial population size
Method Detail

initialize

public Solution[] initialize()
Description copied from interface: Initialization
Returns an array of solutions to become the initial population.

Specified by:
initialize in interface Initialization
Returns:
an array of solutions to become the initial population

initialize

@Deprecated
protected void initialize(Variable variable)
Deprecated. Call variable.randomize() instead

Initializes the specified decision variable randomly. This method supports all built-in types, and can be extended to support custom types.

Parameters:
variable - the variable to be initialized

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!