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 ChangeType
NAME
static ChangeType
ORGANISMS
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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 oneString
getName()
Organism
getOrganismByName(String name)
Gets the specified organismSet
getOrganisms()
Gets the Set of OrganismsIterator
organisms()
void
removeAllOrganisms()
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
setName(String name)
Sets the name of the populationint
size()
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:
ChangeVetoException
IllegalOrganismException
- 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:
ChangeVetoException
IllegalOrganismException
- 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:
ChangeVetoException
IllegalOrganismException
- 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:
ChangeVetoException
IllegalOrganismException
- 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 theOrganisms
inorgs
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeOrganisms
void removeOrganisms(Set orgs) throws ChangeVetoException
Removes all theOrganisms
inorgs
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeAllOrganisms
void removeAllOrganisms() throws ChangeVetoException
Removes all theOrganisms
in 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
-
-