Package org.evoludo.simulator.modules
Class Map2Fitness
Object
Map2Fitness
Map scores/payoffs to fitness and vice versa. Enum on steroids. Currently
available maps are:
- none
- no mapping, scores/payoffs equal fitness
- static
- static baseline fitness,
b+w*score - convex
- convex combination of baseline fitness and scores,
b(1-w)+w*scores - exponential
- exponential mapping,
b*exp(w*score)
- \(F(u)\geq 0\) for every \(u\in\mathbb{R}\)
- \(F(u)\) is non-decreasing
- \(F(u)\) is continuous
- Selection strength \(w\) scales payoffs, i.e. the fitness associated with payoff \(u\) at selection strength \(w\geq 0\) is \(F(w u)\)
- The probability that an individual is chosen for reproduction is invariant under adding a constant \(K\) to the payoffs of all competing individuals. That is, if \(u_i\) and \(F_i(u_i)\) are the payoff and fecundity of individual \(i\), then \[\frac{F_i(u_i)}{\dsum_j F_j(u_j)} = \frac{F_i(u_i+K)}{\dsum_j F_j(u_j+K)}\]
static mapping
then immediately follows as an approximation for weak selection.- Author:
- Christoph Hauert
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing the different types of payoff/score to fitness maps -
Field Summary
FieldsModifier and TypeFieldDescription(package private) doubleBaseline fitness for map.final CLOptionCommand line option to set the payoff/score to fitness map.(package private) Map2Fitness.MapMap type.(package private) ModuleThe module that is using this fitness mapping.(package private) doubleSelection strength for map. -
Constructor Summary
ConstructorsConstructorDescriptionMap2Fitness(Module module, Map2Fitness.Map map) Instantiate new map of typemapformodule. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the baseline fitness of the map.getName()Gets the name/key of the current map.doubleGets the selection strength of the map.getTitle()Gets the brief description of the current map.doubleinvmap(double fitness) Mapfitnessto payoff/score, based on currently selected typemap.booleanisMap(Map2Fitness.Map aMap) Checks if this map is of typeaMap.doublemap(double score) Mapscoreto fitness, based on currently selected typemap.voidsetBaseline(double baseline) Sets the baseline fitness of the map.voidsetMap(Map2Fitness.Map map) Sets type of map tomap.voidsetSelection(double selection) Sets the selection strength of the map.
-
Field Details
-
module
Module moduleThe module that is using this fitness mapping. -
baseline
double baselineBaseline fitness for map. -
selection
double selectionSelection strength for map. -
map
Map2Fitness.Map mapMap type. Defaults toMap2Fitness.Map.NONE. -
clo
Command line option to set the payoff/score to fitness map.
-
-
Constructor Details
-
Map2Fitness
Instantiate new map of typemapformodule.- Parameters:
module- the module using this mappingmap- the map to use as template
-
-
Method Details
-
map
public double map(double score) Mapscoreto fitness, based on currently selected typemap.- Parameters:
score- the payoff/score to convert to fitness- Returns:
- the corresponding fitness
- See Also:
-
invmap
public double invmap(double fitness) Mapfitnessto payoff/score, based on currently selected typemap.- Parameters:
fitness- the fitness to convert to payoff/score- Returns:
- the corresponding payoff/score
-
isMap
Checks if this map is of typeaMap.- Parameters:
aMap- the map to compare to- Returns:
trueif map is of typeaMap.
-
setMap
Sets type of map tomap.- Parameters:
map- the type of the map
-
setBaseline
public void setBaseline(double baseline) Sets the baseline fitness of the map.- Parameters:
baseline- the baseline fitness of the map
-
getBaseline
public double getBaseline()Gets the baseline fitness of the map.- Returns:
- the baseline fitness of the map
-
setSelection
public void setSelection(double selection) Sets the selection strength of the map. Must be positive, ignored otherwise.- Parameters:
selection- the strength of selection of the map
-
getSelection
public double getSelection()Gets the selection strength of the map.- Returns:
- the selection strength of the map
-
getName
Gets the name/key of the current map.- Returns:
- the map key
-
getTitle
Gets the brief description of the current map.- Returns:
- the map summary
-