|
||||||||||
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_ com.rubecula.darwin.domain.world.MateChoice_Evaluator
public class MateChoice_Evaluator
Field Summary | |
---|---|
protected Desirable |
_desirabilityEvaluator
|
protected Choosy |
_desirabilityMinEvaluator
|
Fields inherited from class com.rubecula.darwin.domain.world.MateChoice_ |
---|
_attraction, LOG |
Constructor Summary | |
---|---|
MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random)
Public secondary constructor -- with no evaluator. |
|
MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random,
Desirable desirability,
Choosy undesirability,
Attraction attraction)
|
|
MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random,
com.rubecula.jexpression.Evaluator evaluatorDesirable,
com.rubecula.jexpression.Evaluator evaluatorChoosy)
Public constructor. |
|
MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random,
Function_Desirable functionDesirable,
Function_Choosy functionChoosy)
Public constructor with uniform attraction. |
Method Summary | |
---|---|
void |
enableMateChoiceChanges()
TEST TODO consider eliminating this method. |
protected double |
getDesirability(Organism male)
This implementation returns a value which is: d * g * h
where d is the value of the desirability index defined by the superclass
(see MateChoice_.getDesirabilityIndex(Organism, Organism) ; and g
is one more than the age of the candidate male;
TODO consider a different mechanism here: instead of passing in a random
number to the desirability formula, we should divide the random space
into several bands (or tranches), using Randomizer , and then
cache the various desirability values for age/viability/tranche. |
protected Desirable |
getDesirabilityEvaluator()
|
protected Choosy |
getDesirabilityMinEvaluator()
|
ExpressionMap |
getExpressions()
XXX Need explanation. |
double |
getMinimumDesirability()
By default, this implementation returns a value E^(3.8 * r) where r is a random number between 0 and 1. |
void |
setEvaluator(int index,
java.lang.String expression)
|
void |
setExpression(int index,
java.lang.String expression)
|
void |
setSeed(long seed)
TODO this should have package visibility (but need to fix a test class first). |
Methods inherited from class com.rubecula.darwin.domain.world.MateChoice_ |
---|
chooseMate, createPairBond, equals, findPairs, getAttraction, getAttractionEvaluator, getDesirabilityIndex, getLek, getRandom, getSampleFraction, hashCode, pairUp, setRandom, setSampleFraction |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Desirable _desirabilityEvaluator
protected final Choosy _desirabilityMinEvaluator
Constructor Detail |
---|
public MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random)
random
- a random number generatorpublic MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random, Desirable desirability, Choosy undesirability, Attraction attraction)
random
- desirability
- undesirability
- attraction
- the implementer of sexual selection.public MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random, com.rubecula.jexpression.Evaluator evaluatorDesirable, com.rubecula.jexpression.Evaluator evaluatorChoosy)
random
- a random number generatorevaluatorDesirable
- the expression evaluator to be used for the desirability
formula (or null)evaluatorChoosy
- the expression evaluator to be used for the
minimum-desirability formula (or null)public MateChoice_Evaluator(org.apache.commons.math.random.RandomGenerator random, Function_Desirable functionDesirable, Function_Choosy functionChoosy)
random
- a random number generatorfunctionDesirable
- the expression evaluator to be used for the desirability
formula (or null)functionChoosy
- the expression evaluator to be used for the
minimum-desirability formula (or null)Method Detail |
---|
public void enableMateChoiceChanges()
public ExpressionMap getExpressions()
getExpressions
in interface HasExpressions
String
/ EvalExpressionMutable
pairs.
The String key for each EvalExpressionMutable
is the name
by which that expression will be known in the user interface.HasExpressions.getExpressions()
public double getMinimumDesirability()
getMinimumDesirability
in interface MateChoice
MateChoice.getDesirabilityIndex(Organism, Organism)
MateChoice.getMinimumDesirability()
public void setEvaluator(int index, java.lang.String expression)
index
- expression
- TEST
TODO this should have package visibility (but need to fix a
test class first).public void setExpression(int index, java.lang.String expression) throws FunctionException
index
- expression
- TODO this should have package visibility (but need to fix a
test class first).
FunctionException
public void setSeed(long seed)
seed
- MateChoice_.getRandom()
protected double getDesirability(Organism male)
d * g * h
where d is the value of the desirability index defined by the superclass
(see MateChoice_.getDesirabilityIndex(Organism, Organism)
; and g
is one more than the age of the candidate male;
TODO consider a different mechanism here: instead of passing in a random
number to the desirability formula, we should divide the random space
into several bands (or tranches), using Randomizer
, and then
cache the various desirability values for age/viability/tranche.
getDesirability
in class MateChoice_
r
: d = v * 2^(2r-1)
where v is 10 if viable, 1
otherwise.MateChoice.getDesirabilityIndex(Organism,
Organism)
,
MateChoice_.getDesirabilityIndex(com.rubecula.darwin.domain.helper.Organism,
com.rubecula.darwin.domain.helper.Organism)
,
MateChoice_.getDesirability(com.rubecula.darwin.domain.helper.Organism)
protected Desirable getDesirabilityEvaluator()
_desirabilityEvaluator
protected Choosy getDesirabilityMinEvaluator()
_desirabilityMinEvaluator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |