eaLib API Docs
Last Modified : January 7 2002

mss.ea.ini
Class Initialization

java.lang.Object
  |
  +--mss.ea.core.GeneticOperator
        |
        +--mss.ea.ini.Initialization
All Implemented Interfaces:
IndividualSource
Direct Known Subclasses:
BinaryFileInitialization, FloatInitialization, IntegerArrayInitialization, IntegerInitialization, IntegerSequenceInitialization, ListInitialization, RandomStringInitialization, SalesmanInit, SphereInit, XMLFileInitialization

public abstract class Initialization
extends GeneticOperator
implements IndividualSource

Abstract base class of an initialization operator.

Since:
0.1
Version:
$Revision: 1.1 $ $Date: 2001/11/19 14:24:25 $
Author:
Andreas Rummler

Field Summary
protected  int number
          Number of individuals this operator should produce.
protected  int setSize
          Number of chromosomes to be generated.
 
Fields inherited from class mss.ea.core.GeneticOperator
description, ID, name
 
Constructor Summary
Initialization()
          Constructor.
Initialization(int indNumber)
          Constructor with number of individuals.
Initialization(int indNumber, int chrSetSize)
          Constructor with individual number and chromosome set size.
 
Method Summary
abstract  ChromosomeSet createSet()
          Abstract method for creating a chromosome set.
 int getChromosomeSize()
          Gets the number of chromosomes to be generated.
 int getIndividualNumber()
          Gets the number of individuals to be generated.
 IndividualStream getStream()
          Gets a stream of new individuals.
 Individual next()
          Generates another individual.
 void setChromosomeSize(int size)
          Sets the number of chromosomes to be generated.
 void setIndividualNumber(int indNumber)
          Sets the number of individuals to be generated.
 
Methods inherited from class mss.ea.core.GeneticOperator
getDescription, getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

number

protected int number
Number of individuals this operator should produce. The default value is 1.

setSize

protected int setSize
Number of chromosomes to be generated.
Constructor Detail

Initialization

public Initialization()
Constructor. Sets the number of indiviuals to be generated and the size of the chromosome set to 1.

Initialization

public Initialization(int indNumber)
Constructor with number of individuals. The size of the chromosome set is set to 1.
Parameters:
indNumber - number of chromosomes to be generated

Initialization

public Initialization(int indNumber,
                      int chrSetSize)
Constructor with individual number and chromosome set size.
Parameters:
indNumber - number of individuals to be generated
chrSetSize - number of chromosomes to be generated
Method Detail

createSet

public abstract ChromosomeSet createSet()
Abstract method for creating a chromosome set. This method must be implemented by every subclass for every application. The new chromosome set can be generated by a random generator or based on special knowledge. The method must produce a valid chromosome set, so that the score of an individual produced with this chromosome set is computable.
Returns:
new valid chromosome set

next

public Individual next()
Generates another individual.
Specified by:
next in interface IndividualSource
Returns:
new individual

getStream

public IndividualStream getStream()
Gets a stream of new individuals. The size of the stream is equal to the number given in the constructor.
Specified by:
getStream in interface IndividualSource
Returns:
stream of new individuals

getIndividualNumber

public int getIndividualNumber()
Gets the number of individuals to be generated.
Returns:
number of new individuals

setIndividualNumber

public void setIndividualNumber(int indNumber)
Sets the number of individuals to be generated.
Parameters:
indNumber - number of individuals to generated

getChromosomeSize

public int getChromosomeSize()
Gets the number of chromosomes to be generated.
Returns:
number of chromosomes to be generated

setChromosomeSize

public void setChromosomeSize(int size)
Sets the number of chromosomes to be generated.
Parameters:
size - number of chromosomes to be generated

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS