Individuals.Populations
Interface Population

All Known Implementing Classes:
SimplePopulation

public interface Population

Interface for a population. The population contains the individuals

Author:
Conor

Method Summary
 void add(Individual i)
          Add an individual to the population
 void addAll(java.util.Collection<Individual> immigrants)
          Add a collection of individuals to the population
 void addAll(Population pop)
          Add an entire population to the population
 void clear()
          Clear the population of all individuals
 boolean contains(Individual individual)
          Check if the individual is contained in the population
 Individual get(int index)
          Get an individual from the specified index
 java.util.List<Individual> getAll()
          Get a list of all the individuals
 java.util.Iterator<Individual> iterator()
          Get an iterator over the population
 void remove(Individual ind)
          Remove individual from population
 int size()
          The number of individuals in the population
 void sort()
          Sort the individuals in the population
 

Method Detail

sort

void sort()
Sort the individuals in the population


iterator

java.util.Iterator<Individual> iterator()
Get an iterator over the population

Returns:
iterator over the Individuals

size

int size()
The number of individuals in the population

Returns:
number of individuals

addAll

void addAll(java.util.Collection<Individual> immigrants)
Add a collection of individuals to the population

Parameters:
immigrants - collection of individuals

addAll

void addAll(Population pop)
Add an entire population to the population

Parameters:
pop - population to add

getAll

java.util.List<Individual> getAll()
Get a list of all the individuals

Returns:
list view of the population

contains

boolean contains(Individual individual)
Check if the individual is contained in the population

Parameters:
individual - individual to compare
Returns:
boolean value if the individual exists in the population

add

void add(Individual i)
Add an individual to the population

Parameters:
i - individual to add

get

Individual get(int index)
Get an individual from the specified index

Parameters:
index - which individual to return
Returns:
individual at index

clear

void clear()
Clear the population of all individuals


remove

void remove(Individual ind)
Remove individual from population

Parameters:
ind - individual to remove