Finding the Average Tiger
Explore how to implement and interpret the average tiger statistic in genetic algorithm simulations using Elixir. Understand how the population's traits evolve over generations, adapting to different climates like tropical and tundra. This lesson guides you through calculating averages for age, fitness, and genes to monitor evolutionary trends and differences in traits such as fat stores and fur thickness.
We'll cover the following...
Implementing the average tiger feature
Now that you have extensible statistics tracking in place, you can use it to monitor more insightful statistics for your evolution, such as the average tiger for each climate.
You’ve already identified the fittest tiger for each climate; however, what matters more is how the entire population changes in a given climate. To identify this, you can implement an average_tiger statistic that tells you the average tiger for any given generation.
To do this, start by creating the following average_tiger/1 function in your ...