Adding Mutation

Explore the powers of genetic algorithms through practical examples, all in a language you already know.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Using Mix to Write Genetic Algorithms

Genetic Algorithms in Elixir — by Sean Moriarity (22 / 101)

👈 Looking Deeper into Genetic Algorithms | TOC | Building a Framework for Genetic Algorithms 👉

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

Start by opening a terminal and navigating to the genetic directory you created in the previous chapter, like this:

Inside the genetic directory, create a new Mix project using the new command:

genetic is the name of your Mix project. You can choose whatever name you’d like, so long as it’s a valid name for a Mix project.

Navigate to the genetic directory and inspect its contents, like so:

lib will contain all of the contents of your genetic algorithm framework. It should only contain genetic.ex.

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

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

In addition to the default directories and files, you’ll need a directory named scripts. This directory will contain your solutions to various optimization problems. In a terminal inside of your Mix project, create a new directory, like this:

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

👈 Looking Deeper into Genetic Algorithms | TOC | Building a Framework for Genetic Algorithms 👉

Add a comment

Related posts:

TENTANG MEMULAI

Bukan soal mimpi yang berhasil atau tidak, melainkan bagaimana kita berani melangkah untuk mendapatkan pelajaran dan hikmah serta memulai perjalanan menuju mimpi yang besar. Jadikanlah ketakutan…

Maintaining morale

High morale inoculates a team against temporary pressures. A team with high morale has members that like, trust, and respect each other, which makes them feel more confident in tackling problems…

How to train your own FaceID ConvNet using TensorFlow Eager execution

Faces are everywhere — from photos and videos on social media websites, to consumer security applications like the iPhone Xs FaceID. In this context, computer vision, applied to faces, has many…