com.rubecula.darwin.domain.world
Class Organism_Sexual

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.world.Organism_
          extended by com.rubecula.darwin.domain.world.Organism_Sexual
All Implemented Interfaces:
Censusible, EnvironmentListener, Genetic, Mortal, Organism, Sexual, ComparableValue, Individual, Valuable, java.lang.Cloneable, java.lang.Comparable<Valuable>, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString

public class Organism_Sexual
extends Organism_
implements Sexual

This concrete class represents an individual organism within a Taxon . It contains a Genome from which may be derived a Phenotype in the context of a Genomic.

Adds the following property to Organism_:
sex
accessible by calling isFemale()
;

Renamed 2007/02/07 from Organism_Default to Organism_Sexual

Version:
$Revision: 1.46 $
Author:
Robin Hillyard

Field Summary
 
Fields inherited from class com.rubecula.darwin.domain.world.Organism_
_identifier, _nuclear, LOG
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Method Summary
 Mate createMate(MateChoice chooser, Organism female)
          Create a Mate object based on this Organism [provided that this is male] and the given female.
 Mating createPairBond(MateChoice chooser, Lek lek, Lek alternativeLek)
          If this object is a female and viable, create a pair bond from either population or alternativePopulation.
 java.util.Collection<Organism> getAsexualProgeny(int howMany)
          This implementation of the method yields no progeny because we normally expect sexual organisms to reproduce only sexually.
 boolean isFemale()
          Method to get the sex of this organism.
static Organism seed(Colony colony)
          Class method to create a new Organism_Sexual without parents (for seeding a population).
 
Methods inherited from class com.rubecula.darwin.domain.world.Organism_
age, censusMe, clone, compareTo, equals, getAge, getCensusibleChildren, getColony, getFitness, getGenome, getIdentifier, getMortality, getNuclear, getPhenotype, getValue, getVisualizable, hashCode, isMortal, isNew, isViable, isVisible, normalizeGenome, onEnvironmentChange, setColony, setViability, setViable
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.tostring0.IToString
toString, toStringBrief, toStringId
 

Method Detail

seed

public static Organism seed(Colony colony)
Class method to create a new Organism_Sexual without parents (for seeding a population). As a side effect, the resulting Organism is added to the given population.

Parameters:
colony - the population into which the new instance will be placed and from which the genomic is taken.
Returns:
an instance of Organism_Sexual

createMate

public Mate createMate(MateChoice chooser,
                       Organism female)
Create a Mate object based on this Organism [provided that this is male] and the given female. If this is female, we return null.

Specified by:
createMate in interface Organism
Parameters:
chooser -
female -
Returns:
if this is male, then a newly constructed Mate based on this organism and this organism's desirability as a mate; otherwise null.
See Also:
Organism.createMate(com.rubecula.darwin.domain.helper.MateChoice, com.rubecula.darwin.domain.helper.Organism)

createPairBond

public Mating createPairBond(MateChoice chooser,
                             Lek lek,
                             Lek alternativeLek)
If this object is a female and viable, create a pair bond from either population or alternativePopulation.

Specified by:
createPairBond in interface Organism
Parameters:
chooser -
alternativeLek -
lek - the breeding males from which we will choose a mate
Returns:
if this is a female, then a new Mating object, otherwise null.
See Also:
Organism.createPairBond(com.rubecula.darwin.domain.helper.MateChoice, Lek, Lek)

getAsexualProgeny

public java.util.Collection<Organism> getAsexualProgeny(int howMany)
This implementation of the method yields no progeny because we normally expect sexual organisms to reproduce only sexually. If you need Dolly-style cloning, then you can override this method.

Specified by:
getAsexualProgeny in interface Organism
Parameters:
howMany - ignored
Returns:
an empty collection.

isFemale

public boolean isFemale()
Description copied from interface: Sexual
Method to get the sex of this organism. I will not use the word gender as it is inappropriate!

Specified by:
isFemale in interface Sexual
Returns:
value of Sexual.isFemale() applied to the result of invoking Organism_.getNuclear().
See Also:
Sexual.isFemale()


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.