Package org.biojavax.ga
Interface Population
- All Superinterfaces:
Changeable
- All Known Implementing Classes:
AbstractPopulation,SimplePopulation
A collection of GA organisms
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrganism(Organism org) Adds an Organism to the PopulationvoidaddOrganisms(Set orgs) Adds several organisms to the populationvoidaddOrganisms(Organism[] orgs) Adds several organisms to the populationvoidaddOrganisms(Population orgs) Adds the residents of one population to this onegetName()getOrganismByName(String name) Gets the specified organismGets the Set of OrganismsvoidRemoves all theOrganismsin thisPopulationvoidremoveOrganism(Organism org) Kills off the organismvoidremoveOrganisms(Set orgs) Removes all theOrganismsinorgsvoidremoveOrganisms(Organism[] orgs) Removes all theOrganismsinorgsvoidSets the name of the populationintsize()Gets the Size of the populationMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
ORGANISMS
-
NAME
-
-
Method Details
-
getName
- Returns:
- the name of the population
-
setName
Sets the name of the population- Parameters:
name- set the name to this.- Throws:
ChangeVetoException- if the name may not be changed
-
addOrganism
Adds an Organism to the Population- Parameters:
org- the organism- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
Adds several organisms to the population- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
Adds several organisms to the population- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
Adds the residents of one population to this one- Parameters:
orgs- the population to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
removeOrganism
Kills off the organism- Parameters:
org- the organism to kill- Throws:
ChangeVetoException
-
removeOrganisms
Removes all theOrganismsinorgs- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeOrganisms
Removes all theOrganismsinorgs- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeAllOrganisms
Removes all theOrganismsin thisPopulation- Throws:
ChangeVetoException- if the change is vetoed
-
getOrganismByName
Gets the specified organism- Parameters:
name- the name of the organism to retreive- Returns:
- the organism named or null if that organism doesn't exist.
-
getOrganisms
Gets the Set of Organisms- Returns:
- a Set
-
organisms
- Returns:
- an iterator over the set of Organisms.
-
size
int size()Gets the Size of the population- Returns:
- the size
-