P5-ai-genetic

Jul 20, 2023

Pure Perl genetic algorithm implementation

This module implements a Genetic Algorithm GA in pure Perl. Other Perl modules that achieve the same thing perhaps better, perhaps worse do exist. Please check CPAN. I mainly wrote this module to satisfy my own needs, and to learn something about GAs along the way.

I will not go into the details of GAs here, but here are the bare basics. Plenty of information can be found on the web.

In a GA, a population of individuals compete for survival. Each individual is designated by a set of genes that define its behaviour. Individuals that perform better as defined by the fitness function have a higher chance of mating with other individuals. When two individuals mate, they swap some of their genes, resulting in an individual that has properties from both of its “parents”. Every now and then, a mutation occurs where some gene randomly changes value, resulting in a different individual. If all is well defined, after a few generations, the population should converge on a “good-enough” solution to the problem being tackled.



Checkout these related ports:
  • Zn_poly - C library for polynomial arithmetic
  • Zimpl - Language to translate the LP models into .lp or .mps
  • Zegrapher - Software for plotting mathematical objects
  • Zarray - Dynamically typed N-D expression system based on xtensor
  • Z3 - Z3 Theorem Prover
  • Yices - SMT solver
  • Yacas - Yet Another Computer Algebra System
  • Xtensor - Multi-dimensional arrays with broadcasting and lazy computing
  • Xtensor-python - Python bindings for xtensor
  • Xtensor-io - Xtensor plugin to read/write images, audio files, numpy npz and HDF5
  • Xtensor-blas - BLAS extension to xtensor
  • Xspread - Spreadsheet program for X and terminals
  • Xppaut - Graphical tool for solving differential equations, etc
  • Xplot - X11 plotting package
  • Xlife++ - XLiFE++ eXtended Library of Finite Elements in C++