Logging Statistics Using ETS
Explore how to implement a statistics server using GenServer and ETS in Elixir to log and retrieve evolutionary data such as fitness and age across generations. This lesson teaches you to create a supervised ETS table for quick storage and access of metrics, enabling comprehensive tracking of genetic algorithm progress.
We'll cover the following...
Tracking statistics using GenServer and ETS
During an evolution, we may want to track statistics about fitness, age, or variation in your population over the course of the evolution. For example, perhaps we want to determine the distribution of a particular gene at different generations during evolution. In this lesson, we’ll create a statistics server using a GenServer and an ETS table.
A GenServer is an abstraction around a state that models client-server behavior. It allows us to spin up a long-running process and alter its state through message passing. “ETS” stands for “Erlang Term Storage” and offers a built-in storage API through Erlang interpolation.
The GenServer will allow us to supervise the ETS table which in ...