Package org.biojavax.ga
Interface Population
-
- All Superinterfaces:
Changeable
- All Known Implementing Classes:
AbstractPopulation,SimplePopulation
public interface Population extends Changeable
A collection of GA organisms- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeTypeNAMEstatic ChangeTypeORGANISMS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddOrganism(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 oneStringgetName()OrganismgetOrganismByName(String name)Gets the specified organismSetgetOrganisms()Gets the Set of OrganismsIteratororganisms()voidremoveAllOrganisms()Removes all theOrganismsin thisPopulationvoidremoveOrganism(Organism org)Kills off the organismvoidremoveOrganisms(Set orgs)Removes all theOrganismsinorgsvoidremoveOrganisms(Organism[] orgs)Removes all theOrganismsinorgsvoidsetName(String name)Sets the name of the populationintsize()Gets the Size of the population-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Field Detail
-
ORGANISMS
static final ChangeType ORGANISMS
-
NAME
static final ChangeType NAME
-
-
Method Detail
-
setName
void setName(String name) throws ChangeVetoException
Sets the name of the population- Parameters:
name- set the name to this.- Throws:
ChangeVetoException- if the name may not be changed
-
addOrganism
void addOrganism(Organism org) throws ChangeVetoException, IllegalOrganismException
Adds an Organism to the Population- Parameters:
org- the organism- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
void addOrganisms(Organism[] orgs) throws ChangeVetoException, IllegalOrganismException
Adds several organisms to the population- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
void addOrganisms(Set orgs) throws ChangeVetoException, IllegalOrganismException
Adds several organisms to the population- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
void addOrganisms(Population orgs) throws ChangeVetoException, IllegalOrganismException
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
void removeOrganism(Organism org) throws ChangeVetoException
Kills off the organism- Parameters:
org- the organism to kill- Throws:
ChangeVetoException
-
removeOrganisms
void removeOrganisms(Organism[] orgs) throws ChangeVetoException
Removes all theOrganismsinorgs- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeOrganisms
void removeOrganisms(Set orgs) throws ChangeVetoException
Removes all theOrganismsinorgs- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeAllOrganisms
void removeAllOrganisms() throws ChangeVetoException
Removes all theOrganismsin thisPopulation- Throws:
ChangeVetoException- if the change is vetoed
-
getOrganismByName
Organism getOrganismByName(String name)
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
Set getOrganisms()
Gets the Set of Organisms- Returns:
- a Set
-
size
int size()
Gets the Size of the population- Returns:
- the size
-
-