structure.
- Author:
- Conor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SimplePopulation
public SimplePopulation()
- Creates a new instance of SimplePopulation
SimplePopulation
public SimplePopulation(int size)
add
public void add(Individual i)
- Description copied from interface:
Population
- Add an individual to the population
- Specified by:
add
in interface Population
- Parameters:
i
- individual to add
sort
public void sort()
- Description copied from interface:
Population
- Sort the individuals in the population
- Specified by:
sort
in interface Population
iterator
public java.util.Iterator<Individual> iterator()
- Description copied from interface:
Population
- Get an iterator over the population
- Specified by:
iterator
in interface Population
- Returns:
- iterator over the Individuals
size
public int size()
- Description copied from interface:
Population
- The number of individuals in the population
- Specified by:
size
in interface Population
- Returns:
- number of individuals
addAll
public void addAll(java.util.Collection<Individual> immigrants)
- Description copied from interface:
Population
- Add a collection of individuals to the population
- Specified by:
addAll
in interface Population
- Parameters:
immigrants
- collection of individuals
addAll
public void addAll(Population immigrants)
- Description copied from interface:
Population
- Add an entire population to the population
- Specified by:
addAll
in interface Population
- Parameters:
immigrants
- population to add
getAll
public java.util.List<Individual> getAll()
- Description copied from interface:
Population
- Get a list of all the individuals
- Specified by:
getAll
in interface Population
- Returns:
- list view of the population
contains
public boolean contains(AbstractIndividual individual)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
contains
public boolean contains(Individual individual)
- Description copied from interface:
Population
- Check if the individual is contained in the population
- Specified by:
contains
in interface Population
- Parameters:
individual
- individual to compare
- Returns:
- boolean value if the individual exists in the population
get
public Individual get(int index)
- Description copied from interface:
Population
- Get an individual from the specified index
- Specified by:
get
in interface Population
- Parameters:
index
- which individual to return
- Returns:
- individual at index
clear
public void clear()
- Description copied from interface:
Population
- Clear the population of all individuals
- Specified by:
clear
in interface Population
remove
public void remove(Individual ind)
- Description copied from interface:
Population
- Remove individual from population
- Specified by:
remove
in interface Population
- Parameters:
ind
- individual to remove
set
public Individual set(int i,
Individual ind)