Propeller 0.3.0
Released under the EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0
Yet another Push-based genetic programming system in Clojure.
Installation
To install, add the following dependency to your project or build file:
[net.clojars.lspector/propeller "0.3.0"]
Topics
Namespaces
propeller.genome
The genetic material in Propeller. A plushy
is a list of Push instructions that represent a Push program. They hold the genetic material for an individual
. In the initial population, we create random plushys.
Public variables and functions:
propeller.problems.PSB2.fizz-buzz
FIZZ BUZZ from PSB2 Given an integer x, return “Fizz” if x is divisible by 3, “Buzz” if x is divisible by 5, “FizzBuzz” if x is divisible by 3 and 5, and a string version of x if none of the above hold.
Public variables and functions:
propeller.problems.PSB2.substitution-cipher
SUBSTITUTION CIPHER from PSB2
Public variables and functions:
propeller.problems.PSB2.twitter
TWITTER from PSB2 Given a string representing a tweet, validate whether the tweet meets Twitter’s original character requirements. If the tweet has more than 140 characters, return the string “Too many characters”. If the tweet is empty, return the string “You didn’t type anything”. Otherwise, return “Your tweet has X characters”, where the X is the number of characters in the tweet.
Public variables and functions:
propeller.problems.valiant
Possibly impossible to solve with genetic programming. Stems from the work of Leslie Valiant and involves determining the parity of an unknown subsequence of a larger sequence of bits.
Public variables and functions:
propeller.push.instructions.input-output
Push instructions for input and output.
Public variables and functions:
propeller.push.instructions.vector
Vector instructions for all vector element subtypes: BOOLEAN, FLOAT, INTEGER, and STRING.
propeller.push.limits
Values used by the Push instructions to keep the stack sizes within reasonable limits and values used by the Push instructions to keep computed values within reasonable size limits.
Public variables and functions:
propeller.selection
Propeller includes many kinds of genetic operators to select parents within the population such as tournament selection, lexicase selection, and epsilon lexicase selection.
Public variables and functions:
propeller.session
The “session” namespace is for trying things out interactively. For example, you can use it to test a new Push instruction by running a program that uses it and seeing the result. You might just want to do this interactively in the REPL, but the session file makes it a little easier since it already requires most of the namespaces you’ll want to refer to.
Public variables and functions:
propeller.simplification
To use Propeller’s auto-simplification system, simply include the following four command line arguments when running a problem:
Public variables and functions:
propeller.variation
Propeller includes many kinds of genetic operators to create variation within the population. You can specify the rate of the variation genetic operators with the :variation
map.