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 TypeMethodDescriptionvoid
addOrganism
(Organism org) Adds an Organism to the Populationvoid
addOrganisms
(Set orgs) Adds several organisms to the populationvoid
addOrganisms
(Organism[] orgs) Adds several organisms to the populationvoid
addOrganisms
(Population orgs) Adds the residents of one population to this onegetName()
getOrganismByName
(String name) Gets the specified organismGets the Set of Organismsvoid
Removes all theOrganisms
in thisPopulation
void
removeOrganism
(Organism org) Kills off the organismvoid
removeOrganisms
(Set orgs) Removes all theOrganisms
inorgs
void
removeOrganisms
(Organism[] orgs) Removes all theOrganisms
inorgs
void
Sets the name of the populationint
size()
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:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
addOrganisms
Adds several organisms to the population- Parameters:
orgs
- the organisms to add- Throws:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
addOrganisms
Adds several organisms to the population- Parameters:
orgs
- the organisms to add- Throws:
ChangeVetoException
IllegalOrganismException
- 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:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
removeOrganism
Kills off the organism- Parameters:
org
- the organism to kill- Throws:
ChangeVetoException
-
removeOrganisms
Removes all theOrganisms
inorgs
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeOrganisms
Removes all theOrganisms
inorgs
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeAllOrganisms
Removes all theOrganisms
in 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
-