monkeys
"If an army of monkeys were strumming on typewriters they might write all the books in the British Museum."
monkeys
is a framework designed to make genetic programming in Python accessible, quick, flexible, and fun.
What is genetic programming?
Genetic programming algorithms are a class of evolutionary algorithms in which solutions to a problem are represented as executable tree structures - programs. In order to use genetic programming in order to solve a problem, two things must be specified:
-
What form(s) a potential solution can take.
-
A method of scoring solutions based on their meritoriousness.
Given these, a genetic programming system can perform intelligent exploration and search through the space of potential solutions, narrowing in on those programs that best solve the problem as specified. Genetic programming has achieved human-competitive results in a wide swath of domains, including:
- Satellite antenna design for NASA
- The creation of novel quantum computing algorithms
- Evolving game AI
- The automatic repair of buggy code.
monkeys to the rescue!
"Ford, there's an infinite number of monkeys outside who want to talk to us about this script for Hamlet they've worked out."
monkeys
makes getting started with genetic programming painless and fun. Install monkeys
by running:
pip install monkeys
monkeys
uses a variant of genetic programming called "strongly-typed genetic programming" in order to allow you to quickly and easily specify how your programs should be structured.
monkeys
supports Python 2.7 and 3.x.
Examples
Tutorials:
- Getting started with monkeys: An introduction to the
monkeys
framework, which outlines the type system. - Monkeys in abstract syntax trees: using
monkeys
to generate Python code directly. - Debugging with monkeys: A guide for discovering and diagnosing bugs in your codebase with
monkeys
.
Sample usages:
- Linting by example: Generating linting rules by supplying positive/negative code examples.
- Solving logic puzzles with monkeys: Solving logic puzzles using the
monkeys
diagnostic tool. - More to come!
Contacts
- Name: H. Chase Stevens
- Twitter: @hchasestevens