|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rubecula.darwin.domain.world.MateChoice_
public abstract class MateChoice_
Abstract class defining the base methods of MateChoice.
Field Summary | |
---|---|
protected Attraction |
_attraction
|
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
Constructor Summary | |
---|---|
protected |
MateChoice_(org.apache.commons.math.random.RandomGenerator random,
Attraction attraction)
protected constructor. |
Method Summary | |
---|---|
Organism |
chooseMate(Organism female,
Lek lek)
Choose the best (male) mate for the given female , from among
all of the organisms at the lek . |
Mating |
createPairBond(Organism female,
Lek lek,
Lek alternativeLek)
First, we call MateChoice.pairUp(Organism, Lek) for the
female , lek and the appropriate genomic. |
boolean |
equals(java.lang.Object obj)
|
java.util.Collection<Mating> |
findPairs(java.util.Collection<Organism> organisms,
Lek lek,
Lek alternativeLek)
Method to enumerate a set of mating pairs: females from the given set of organisms and males from either the lek or the
alternativeLek . |
protected double |
getAttraction(Organism female,
Organism male)
|
protected Attraction |
getAttractionEvaluator()
|
protected double |
getDesirability(Organism male)
|
double |
getDesirabilityIndex(Organism female,
Organism male)
Method to determine the desirability of a given male in the eyes, etc. |
Lek |
getLek(Colony colony)
Method to get a "lek", that is to say a population of breeding males. |
org.apache.commons.math.random.RandomGenerator |
getRandom()
Getter/setter typically called by reflection, but also called via this interface. |
protected double |
getSampleFraction()
|
int |
hashCode()
|
Mating |
pairUp(Organism female,
Lek lek)
Method to create a Mating object based on the female given and a
male chosen from the lek. |
void |
setRandom(org.apache.commons.math.random.RandomGenerator random)
Reset the current random number generator. |
void |
setSampleFraction(double sampleFraction)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.rubecula.darwin.domain.helper.MateChoice |
---|
getMinimumDesirability |
Field Detail |
---|
protected final Attraction _attraction
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
protected MateChoice_(org.apache.commons.math.random.RandomGenerator random, Attraction attraction)
random
- random number source.attraction
- sexual selection evaluator (if null then Attraction_Uniform is
employed).Method Detail |
---|
public Organism chooseMate(Organism female, Lek lek)
female
, from among
all of the organisms at the lek
.
Typically, the lek is only a sample of available breeding males. If no
mate can be found amongst the sample, we look at the remainder, in case
we can find a mate among those. This is primarily an optimization.
chooseMate
in interface MateChoice
female
- lek
- a collection of organisms from which to choose a (male) mate
for the given female, (note that, currently, not all of the
organisms are male, some are competing females).
public Mating createPairBond(Organism female, Lek lek, Lek alternativeLek)
MateChoice.pairUp(Organism, Lek)
for the
female
, lek
and the appropriate genomic. If
this is not-null, we return it. Otherwise, we invoke
Insular.isIsolated()
and IF the result is false, AND if the
alternative lek is not null and its colony is not the same as this
colony, THEN we invoke MateChoice.pairUp(Organism, Lek)
for the
female
, alternativeLek
and the appropriate
genomic. We return the result.
This method should only be called if the female organism is in fact
female.
createPairBond
in interface MateChoice
female
- the organism for whom we require a mate.lek
- the primary lek from which the female chooses a matealternativeLek
- the alternative lek from which the female chooses a mate (may
be null)
Mating
object, or null.MateChoice.createPairBond(com.rubecula.darwin.domain.helper.Organism,
com.rubecula.darwin.domain.world.Lek,
com.rubecula.darwin.domain.world.Lek)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.util.Collection<Mating> findPairs(java.util.Collection<Organism> organisms, Lek lek, Lek alternativeLek)
lek
or the
alternativeLek
.
Unlike the rest of the Darwin package, there IS an asymmetry here between
the sexes. Every female organism is involved in exactly one mating per
generation. However, males are chosen randomly and can therefore be
involved in any number of matings in a given generation.
findPairs
in interface MateChoice
organisms
- a collection of organisms from which we will take females and
pair them up.lek
- alternativeLek
-
public double getDesirabilityIndex(Organism female, Organism male)
getDesirabilityIndex
in interface MateChoice
female
- the choosy female.male
- the poor schmuck male.
MateChoice.getDesirabilityIndex(com.rubecula.darwin.domain.helper.Organism,
com.rubecula.darwin.domain.helper.Organism)
public Lek getLek(Colony colony)
MateChoice
getLek
in interface MateChoice
colony
- the colony from which we choose a lek (may be null).
colony
is null.MateChoice.getLek(Colony)
public org.apache.commons.math.random.RandomGenerator getRandom()
MateChoice
getRandom
in interface MateChoice
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public Mating pairUp(Organism female, Lek lek)
MateChoice
Mating
object based on the female given and a
male chosen from the lek.
pairUp
in interface MateChoice
female
- lek
- a collection of organisms from which to choose a (male) mate
for the given female, (note that not all of the organisms are
male, some are competing females).
Mating_Haldanian
if a suitable male
was found, else null.MateChoice.pairUp(com.rubecula.darwin.domain.helper.Organism,
Lek)
public void setRandom(org.apache.commons.math.random.RandomGenerator random)
setRandom
in interface MateChoice
random
- random number generator.MateChoice.setRandom(org.apache.commons.math.random.RandomGenerator)
public void setSampleFraction(double sampleFraction)
sampleFraction
- the sampleFraction to setprotected double getAttraction(Organism female, Organism male)
female
- male
-
protected Attraction getAttractionEvaluator()
protected double getDesirability(Organism male)
male
-
r
: d = v * 2^(2r-1)
where v is 10 if viable, 1
otherwise.protected double getSampleFraction()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |