Course:CPSC312-2018-Genetic Algorithm Library

From UBC Wiki

Genetic Algorithm Library

Authors: Salva, Ofir, Junsu

What is the problem?

Implementing a library for genetic algorithms. The library would be independent from the structure of the problem.

What is the something extra?

We have applied our new library to a real problem where we have a binary list as a target (e.g: [1,1,1,1,1,1]) and we want to reach this target from an initial random population of chromosomes by mutating and crossing them.

The Mutation function for this problem consists on picking a random gene (element on the list) and swap it bit from 1 to 0 and viceversa.

The Cross function wil take two parents, split them in two halfs and combine them so we have two new son chromosomes.

All our functions work with arbitrary types of genes, length, and fitness, cross and mutate functions.

What did we learn from doing this?

  • We have learned much about high-order functionality and polymorphism of haskell by trying our functions to work on arbitrary types of genes, length and fitness functions.
  • Work with random numbers
  • Split Haskell projects into modules
  • Install and use Haskell libraries.

Links to code etc

https://github.com/junsushin-dev/Genetic-Algorithm-Library