Giter Club home page Giter Club logo

darwin.js's Introduction

darwin.js

A JavaScript framework for Evolutionary Algorithms.

This framework is work in progress. The goal is to provide a general framework for the following type of evolutionary algorithms:

  • Genetic Algorithms
  • Genetic Programming
  • Evolution Strategies - Support for both (μ + λ) and (μ, λ) evolution strategies.

Recombination

  • One Point Crossover
  • N-Point Crossover
  • Uniform Crossover

Selection

  • Fitness Proportional Selection
  • Ranking Selection
  • Tournament Selection

Callbacks

Callback Description
ea-started Fires once, when the EA starts
generation-started Fires when a new generation starts
population-generated Fires when the population generated on every generation
population-evaluated Fires when the population is evaluated at the beginning of a generation
generation-finished Fires when a new generation ends
ea-finished Fires once, when the EA ends
reset Fires when the EA is reset

Examples

Genetic Algorithm - String Evolver

var charPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ",
    mutationRate = 0.10,
    wordToFind = "HELLO WORLD",
    stringEvolver = new Darwin.GA({
        populationSize: 100,
        individualFactory: StringEvolver.createRandomStringGenerator(charPool, wordToFind.length),
        fitnessFunction: StringEvolver.createWordFitnessFunction(wordToFind),
        select: Darwin.Selection.randomTopPercent,
        reproduce: Darwin.Operators.singlePointCrossover,
        mutate: StringEvolver.createRandomCharacterMutation(charPool, mutationRate),
        terminationConditions: [new Darwin.Termination.TargetFitness(wordToFind.length)]
    });
    stringEvolver.run()

Evolution Strategy - String Evolver

var wordToFind = "HELLO WORLD",
    charPool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ",
    mutationRate = 0.10,
    stringEvolver = new Darwin.ES({
        parentsSize: 10,
        childrenSize: 40,
        plusSelection: true,
        individualFactory: StringEvolver.createRandomStringGenerator(charPool, wordToFind.length),
        fitnessFunction: StringEvolver.createWordFitnessFunction(wordToFind),
        mutate: StringEvolver.createRandomCharacterMutation(charPool, mutationRate),
        terminationConditions: [new Darwin.Termination.TargetFitness(wordToFind.length)]
    }),
    stringEvolver.run()

Dashboard

String Evolver

Monte Carlo PI Demo

darwin.js's People

Contributors

davidrobles avatar

Stargazers

Cameron Smith avatar  avatar Michael Anthony avatar Chester Holtz avatar  avatar Jordan Eldredge avatar

Watchers

Jordan Eldredge avatar  avatar James Cloos avatar Michael Anthony avatar

Forkers

choltz95

darwin.js's Issues

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.