...

/

Building a Framework for Genetic Algorithms

Building a Framework for Genetic Algorithms

Learn how you can design the framework for a genetic algorithm.

Using Mix to write genetic algorithms

Elixir projects are created, built, and tested using Mix. We’ll use Mix for managing dependencies, testing libraries, and running genetic algorithms. For now, we’ll create a Mix project that contains a framework for writing genetic algorithms.

We can easily create a new Mix project using the mix new genetic command in the given terminal:

Terminal 1
Terminal
Loading...

Over here, genetic is the name of your Mix project.

Note: You can choose whatever name you’d like, so long as it’s a valid name for a Mix project.

After creating the Mix project, next, navigate to the genetic directory and inspect its contents.

The lib directory will contain all of the contents of the genetic algorithm framework. So far, it should only contain genetic.ex.

The test directory will contain all of the tests. Don’t worry about the contents of this directory for now.

The mix.exs file will contain dependencies and other project configurations. The default configuration is sufficient for now.

In addition to the default directories and files, we’ll also need a directory named scripts. This directory will contain our solutions to various optimization problems. This has already been created behind the scenes.

With the project set up, it’s time to create our ...

Access this course and 1400+ top-rated courses and projects.