All Projects → evvo-labs → Evvo

evvo-labs / Evvo

Licence: apache-2.0
Solve multi-objective optimization problems with distributed evolutionary algorithms

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Evvo

geneticalgorithm2
Supported highly optimized and flexible genetic algorithm package for python
Stars: ✭ 36 (-40.98%)
Mutual labels:  evolution, evolutionary-algorithms
exact
EXONA: The Evolutionary eXploration of Neural Networks Framework -- EXACT, EXALT and EXAMM
Stars: ✭ 43 (-29.51%)
Mutual labels:  evolution, evolutionary-algorithms
Darwin
Evolutionary Algorithms Framework
Stars: ✭ 72 (+18.03%)
Mutual labels:  evolutionary-algorithms, evolution
tiny gp
Tiny Genetic Programming in Python
Stars: ✭ 58 (-4.92%)
Mutual labels:  evolution, evolutionary-algorithms
Geatpy
Evolutionary algorithm toolbox and framework with high performance for Python
Stars: ✭ 990 (+1522.95%)
Mutual labels:  evolutionary-algorithms
Unix History Repo
Continuous Unix commit history from 1970 until today
Stars: ✭ 4,851 (+7852.46%)
Mutual labels:  evolution
Geneticalgorithmpython
Source code of PyGAD, a Python 3 library for building the genetic algorithm and training machine learning algorithms (Keras & PyTorch).
Stars: ✭ 435 (+613.11%)
Mutual labels:  evolutionary-algorithms
Ecosim
An interactive ecosystem and evolution simulator written in C and OpenGL, for GNU/Linux.
Stars: ✭ 382 (+526.23%)
Mutual labels:  evolution
Applying eanns
A 2D Unity simulation in which cars learn to navigate themselves through different courses. The cars are steered by a feedforward neural network. The weights of the network are trained using a modified genetic algorithm.
Stars: ✭ 1,093 (+1691.8%)
Mutual labels:  evolutionary-algorithms
Quota Alignment
Guided synteny alignment between duplicated genomes (within specified quota constraint)
Stars: ✭ 47 (-22.95%)
Mutual labels:  evolution
Thrive
The main repository for the development of the evolution game Thrive.
Stars: ✭ 874 (+1332.79%)
Mutual labels:  evolution
Pagmo2
A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
Stars: ✭ 540 (+785.25%)
Mutual labels:  evolutionary-algorithms
Bolero
Behavior Optimization and Learning for Robots
Stars: ✭ 39 (-36.07%)
Mutual labels:  evolutionary-algorithms
Platemo
Evolutionary multi-objective optimization platform
Stars: ✭ 454 (+644.26%)
Mutual labels:  evolutionary-algorithms
Nsganetv2
[ECCV2020] NSGANetV2: Evolutionary Multi-Objective Surrogate-Assisted Neural Architecture Search
Stars: ✭ 52 (-14.75%)
Mutual labels:  evolutionary-algorithms
Optim
OptimLib: a lightweight C++ library of numerical optimization methods for nonlinear functions
Stars: ✭ 411 (+573.77%)
Mutual labels:  evolutionary-algorithms
Cafe fig
A tool to extract and visualize the results of CAFE (Computational Analysis of gene Family Evolution)
Stars: ✭ 22 (-63.93%)
Mutual labels:  evolution
Nsga2 Matlab
A very fast, 90% vectorized, NSGA-II algorithm in matlab.
Stars: ✭ 40 (-34.43%)
Mutual labels:  evolutionary-algorithms
Eaopt
🍀 Evolutionary optimization library for Go (genetic algorithm, partical swarm optimization, differential evolution)
Stars: ✭ 718 (+1077.05%)
Mutual labels:  evolutionary-algorithms
Invaderz
Space invaders, but the invaders evolve with genetic algorithm
Stars: ✭ 686 (+1024.59%)
Mutual labels:  evolution

Evvo travis master status

Evvo is the Scala framework for distributed multi-objective evolutionary computing.

Evvo supports:

  • Distributed evolutionary computing on heterogenous networks
  • User-defined problem and solution types
  • Sane, but overridable, defaults, almost everywhere
  • Built-in problem types for common solution type representations, e.x. bitstrings
  • (planned) Real-time visualization of the evolutionary process
  • (planned) The ability for users to dynamically add solutions and contraints to the population

NOTE: This code is provided as a public beta

Evvo is in beta. The API is not stable, and is guaranteed to change in the future. This is made clear by the version being v0.*.*. Once the major version is 1, the API will be stable. Do not use this code in production.


Here's an example showing how simple it is to set up and solve a basic problem (on one machine) using Evvo. Let's say we want to maximize the number of ones in a Bitstring. To represent this objective, we'll need to write an Objective (who would have guessed?). Then we can use Evvo to search for Bitstrings that satisfy the Objective. After running for a second, we'll print the current pareto frontier.

import io.evvo.agent.defaults.{Bitstring, Bitflipper, BitstringGenerator, DeleteDominated}
import io.evvo.island.{EvvoIsland, LocalIslandManager, StopAfter}
import io.evvo.island.population.{Maximize(), Objective}
import scala.concurrent.duration._

object Maximize()1Bits extends Objective[Bitstring]("1Bits", Maximize()) {
  override protected def objective(sol: Bitstring): Double = {
    sol.count(identity) // Bitstrings are represented as Seq[Boolean], count `true`s
  }
}


val islandBuilder = EvvoIsland.builder[Bitstring]()
  .addCreator(BitstringGenerator(length=16))
  .addModifier(Bitflipper())
  .addDeletor(DeleteDominated[Bitstring]())
  .addObjective(Maximize()1Bits)

val islandManager = new LocalIslandManager(numIslands = 1, islandBuilder)
islandManager.runBlocking(StopAfter(1.second))

print(islandManager.currentParetoFrontier())

This will run three asynchronous agents locally. BitstringGenerator creates Bitstrings of length 16 with randomly initialized bits, Bitflipper flips a random bit, and DeleteDominated will pick Bitstrings out of the generated solutions and delete the dominated ones. If you run this code on anything more powerful than a toaster, here's what will be printed:

ParetoFrontier(Map(1Bits -> 16.0))

This means that there was one solution on the pareto frontier, which scored 16.0 according to the objective named "1Bits". Since the generated Bitstrings only have 16 bits, the best possible score is 16.0 bits that are 1. Note that the pareto frontier doesn't print the actual solutions. The solutions are available within the ParetoFrontier class, but the toString method prints only the scores, because solutions to more complex problems are very large.

If our built-in Creators, Modifiers, and Deletors do not work for your problem, you can define your own as easily as we defined Maximize()1Bits.

If you want to jump directly into an example, check out the quickstart guide. It assumes some familiarity with evolutionary computing concepts, so you may need to cross reference the terminology and diagrams in this file while you are working through the example.


Terminology

Island: a population with multiple agents which can communicate with other islands for immigration and emigration.

Population: a mutable set of scored solutions from which the Pareto Frontier is calculated.

Pareto Frontier: a set of non-dominated solutions.

Dominated Solution: a dominated solution is worse in every regard (as captured by the objectives) than another solution, or worse in one regard and equal on others. For example, if there are three objective functions, each of which is to be maximized, then a solution scoring (3, 9, 4) would be dominated by one scoring (5, 11, 4), but not one scoring (5, 11, 3).

Objective: a single goal in the broader optimization problem.

Fitness: how strong a solution is as determined by the objectives.

Agent: not an Akka actor, but a part of an asynchronous evolutionary system. Each one runs on a separate thread.

Creator Agent: often shortened to "Creator", a Creator Agent generates a set of solutions and adds those solutions to the population.

Modifier Agent: often shortened to "Modifier", a Modifier Agent retrieves some number of solutions from the population, calls a function on that set of solutions to produce new solutions based on the input, and adds those new solutions to the population.

Mutator Agent: A type of ModifierAgent that applies a one-to-one mapping over a set of solutions, and adds all the results.

Crossover Agent: A type of ModifierAgent that applies a two-to-one function over a set of solutions, taking part of each input solution and combining them to produce new solutions.

Deletor Agent: often shortened to "Deletor", a Deletor Agent retrieves some number of solutions from the population and deletes the bad ones (for whatever definition of bad it's working with) from the population.

Emigration: an island sending solutions to another island.

Immigration: an island receiving solutions from another island.


The Model

Asycnchronous Evolutionary Computing

Asynchronous multi-agent evolutionary computing systems consist of a common population and multiple "evolutionary agents" that operate on the population. These agents, working in parallel, gradually push the overall fitness of a population upwards. (Assuming that the modifiers have a chance of improving fitness, and the deletors remove solutions that tend to be worse than average.) This system is easily parallelizable, as there is only one piece of shared memory - the set of solutions currently in the population. Much of the work (the work of computing new solutions, mutating existing solutions, and deciding which solutions to delete) can be distributed across multiple CPU cores, or even multiple machines.

This diagram illustrates each of the major components in Evvo and their roles:

+-------------------------------------------------------------------------+
|                                                                         |
| EvvoIsland                                                              |
|                                                                         |
+-------------------------------------------------------------------------+
|                                                                         |
|                                                   +------------------+  |
|  +---------------+       Generates new solutions  |                  |  |
|  |               |<-------------------------------| Creator Agent(s) |  |
|  | Population    |                                |                  |  |
|  |               |                                +------------------+  |
|  +---------------+                                                      |
|  |               | Reads some solutions           +------------------+  |<--+
|  |  - Objectives |------------------------------->|                  |  |   |
|  |               |                                | Modifier Agent(s)|  |   |
|  |  - Solutions  |<-------------------------------|                  |  |   | Immigration +
|  |               |         Derives new solutions  +------------------+  |   | Emigration
|  |               |                                                      |   |  Peer-to-peer gossip
|  |               | Reads some solutions           +------------------+  |   |  protocol for
|  |               |------------------------------->|                  |  |   |  sharing solutions
|  |               |                                | Deletor Agent(s) |  |   |  increases
|  |               |<-------------------------------|                  |  |   |  scalability without
|  |               |        Chooses some to delete  +------------------+  |   |  converging to local
|  +---------------+                                                      |   |  optima.
|                                                                         |   |
+-------------------------------------------------------------------------+   |  This is how Evvo
                                   ^                                          |  takes advantage of
                                   |  Immigration / Emigration                |  parallelism.
                                   v                                          |
+--------------------------------------------------------------------------+  |
|                                                                          |  |
| EvvoIsland     [Same contents as above, abbreviated for clarity]         |  |
|                                                                          |  |
+--------------------------------------------------------------------------+  |
                                   ^                                          |
                                   |  Immigration / Emigration                |
                                   v                                          |
+--------------------------------------------------------------------------+  |
|                                                                          |  |
| EvvoIsland     [Same contents as above, abbreviated for clarity]         |<-+
|                                                                          |
+--------------------------------------------------------------------------+

                                    .
                                    .
                                    .

                                and so on

Quickstart

The quickstart guide will walk you through writing and running a problem using Evvo. It solves a variant on the traveling salesperson problem with two objectives. If you're interested in seeing more of the developer API or understanding how to use Evvo, check this out next.


Downloads

Evvo v0.0.0 has been released! Keep in mind, consistent with the warning above: the APIs used here are not stable, and this code is not production-ready. But we hope you have fun experimenting with this release!

To get the dependency, use this for maven:

<dependency>
    <groupId>io.evvo</groupId>
    <artifactId>evvo_2.13</artifactId>
    <version>0.0.0</version>
</dependency>

Or this, for sbt

resolvers += Resolver.sonatypeRepo("releases")
libraryDependencies += "io.evvo" %% "evvo" % "0.0.0"

Parallelism

Setting up Servers

Evvo is dockerized. Follow the instructions to get started running your own network-parallel instance.

Serializability

Because we have to ship Islands to remote servers, Islands need to be serializable. All of the code provided by Evvo is serializable, but the creators, modifiers, deletors, and objectives that you provide must also be serializable for the Islands to serialize and deserialize correctly.

See the relevant section of the Scala cookbook on serialization. Note that serialized classes should also have referential transparency, that is, they should not reference variables from an external scope. A class defined within an object (or another class, or a code block) that references variablees defined in the outer object (or class, or code block) may cause serialization issues if those values are not present in the deserialization context. In general, extending Creator, Modifier, or DeletorFunction, with case classes, and ensuring that those case classes take all the data they need as arguments will be sufficient to ensure that there are no serialization issues.

If you use a LocalIslandManager to create LocalEvvoIslands, your data will still be serialized and deserialized, albeit on the same machine. This means that some of the most flagrant serialization exceptions can be caught early by testing with LocalIslandManager.


Contributing

See CONTRIBUTING.MD for information on how to contribute code to Evvo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].