lio.population
Class Population

java.lang.Object
  extended by lio.population.Population
Direct Known Subclasses:
StaticPopulation, VariablePopulation

public abstract class Population
extends java.lang.Object


Field Summary
protected  int size
          Size of the population
 
Constructor Summary
Population()
           
 
Method Summary
 Individual copyElementAt(int position)
          Returns a copy of the element at the given position.
abstract  Individual elementAt(int position)
          Returns a reference to the individual in the given position.
abstract  Individual[] individuals()
          Returns an array containing all individuals.
abstract  void setElementAt(int position, Individual individual)
          Replaces the element at given position.
 int size()
          Returns the size of the population.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
Size of the population

Constructor Detail

Population

public Population()
Method Detail

elementAt

public abstract Individual elementAt(int position)
Returns a reference to the individual in the given position.

Parameters:
position - Individual that is referenced.
Returns:
The individual that occupies position position.

copyElementAt

public Individual copyElementAt(int position)
Returns a copy of the element at the given position.

Parameters:
position - Position of the required element.
Returns:
A copy of the element in position.

setElementAt

public abstract void setElementAt(int position,
                                  Individual individual)
Replaces the element at given position.

Parameters:
position - Position where the individual will be placed.
individual - Individual to be stored at the population.

individuals

public abstract Individual[] individuals()
Returns an array containing all individuals.

Returns:
Individuals of the population.

size

public int size()
Returns the size of the population.

Returns:
Value of property size.