Class Map2Fitness

Object
Map2Fitness

public class Map2Fitness extends Object
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)
Note that exponential payoff-to-fitness may easily be the most convincing because it can be easily and uniquely derived from a set of five natural assumptions on the fitness function \(F(u\):
  1. \(F(u)\geq 0\) for every \(u\in\mathbb{R}\)
  2. \(F(u)\) is non-decreasing
  3. \(F(u)\) is continuous
  4. Selection strength \(w\) scales payoffs, i.e. the fitness associated with payoff \(u\) at selection strength \(w\geq 0\) is \(F(w u)\)
  5. 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)}\]
Up to a rescaling of the selection strength, these assumptions lead to a unique payoff-to-fecundity map, \(F(u)=e^{w u}\). The static mapping then immediately follows as an approximation for weak selection.
Author:
Christoph Hauert
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum representing the different types of payoff/score to fitness maps
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) double
    Baseline fitness for map.
    final CLOption
    Command line option to set the payoff/score to fitness map.
    (package private) Map2Fitness.Map
    Map type.
    (package private) Module
    The module that is using this fitness mapping.
    (package private) double
    Selection strength for map.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiate new map of type map for module.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the baseline fitness of the map.
    Gets the name/key of the current map.
    double
    Gets the selection strength of the map.
    Gets the brief description of the current map.
    double
    invmap(double fitness)
    Map fitness to payoff/score, based on currently selected type map.
    boolean
    Checks if this map is of type aMap.
    double
    map(double score)
    Map score to fitness, based on currently selected type map.
    void
    setBaseline(double baseline)
    Sets the baseline fitness of the map.
    void
    Sets type of map to map.
    void
    setSelection(double selection)
    Sets the selection strength of the map.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • module

      Module module
      The module that is using this fitness mapping.
    • baseline

      double baseline
      Baseline fitness for map.
    • selection

      double selection
      Selection strength for map.
    • map

      Map type. Defaults to Map2Fitness.Map.NONE.
    • clo

      public final CLOption clo
      Command line option to set the payoff/score to fitness map.
  • Constructor Details

    • Map2Fitness

      public Map2Fitness(Module module, Map2Fitness.Map map)
      Instantiate new map of type map for module.
      Parameters:
      module - the module using this mapping
      map - the map to use as template
  • Method Details

    • map

      public double map(double score)
      Map score to fitness, based on currently selected type map.
      Parameters:
      score - the payoff/score to convert to fitness
      Returns:
      the corresponding fitness
      See Also:
    • invmap

      public double invmap(double fitness)
      Map fitness to payoff/score, based on currently selected type map.
      Parameters:
      fitness - the fitness to convert to payoff/score
      Returns:
      the corresponding payoff/score
    • isMap

      public boolean isMap(Map2Fitness.Map aMap)
      Checks if this map is of type aMap.
      Parameters:
      aMap - the map to compare to
      Returns:
      true if map is of type aMap.
    • setMap

      public void setMap(Map2Fitness.Map map)
      Sets type of map to map.
      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

      public String getName()
      Gets the name/key of the current map.
      Returns:
      the map key
    • getTitle

      public String getTitle()
      Gets the brief description of the current map.
      Returns:
      the map summary