Giter Site home page Giter Site logo

genex's Introduction

Genex

Genex makes it easy to write Genetic Algorithms with Elixir.

Build Status Coverage Status Hex Version

This library is inspired by Python's DEAP.

Documentation

Documentation is available at here.

Installation

The package can be installed by adding genex to your list of dependencies in mix.exs.

def deps do
  [
    {:genex, "~> 1.0.0-beta"}
  ]
end

Usage

Genex requires an implementation module with 3 functions: genotype/0, fitness_function/1, and terminate?/1.

defmodule OneMax do
  use Genex

  def genotype, do: Genotype.binary(10)

  def fitness_function(chromosome), do: Enum.sum(chromosome.genes)

  def terminate?(population), do: population.max_fitness == 10
end

Now, run iex -S mix.

Then:

  iex> OneMax.run()

Features

Genex strives to be as simple and customizable as possible. Along with the ability to customize EVERY step of your Genetic algorithm, Genex comes with the following features:

  • 6 Selection Operators (14 anticipated)
  • 12 Crossover Operators (17 anticipated)
  • 4 Mutation Operators (9 anticipated)
  • Fully Customizable Evolutions
  • Multi-Objective Optimization
  • Penalty Functions
  • Genotype Generation Helpers
  • Benchmarking of Common Problems
  • Exportable Genealogy Tree
  • Exportable Hall of Fame
  • Flexible Encoding of Chromosomes (any Enum)
  • Extendable Visualizations

To request a feature, please open an issue.

Examples

There are currently 5 basic examples available in the examples directory. To run them, clone the repo and run:

mix run examples/[example].exs

The current examples are:

  • one_max.exs
  • knapsack.exs
  • speller.exs
  • tsp.exs
  • n_queens.exs
  • knapsack.exs

Genex in Practice

These projects use Genex in practice:

To feature yours, please submit a pull request.

Contributing

If you have any problems with Genex, please open an issue! If you have a fix for an issue, submit a pull request.

genex's People

Contributors

dokie avatar seanmor5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.