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
- Adding Genetic Operators
- Adding a Problem
- Adding a Selection Method
- A Guide to Experimentation
- Genetic Programming Loop
- Genome
- Introduction to Propeller
- Library Reference
- Selection
- Simplification
- Variation
Namespaces
propeller.problems.PSB2.basement
=========== PROBLEM DESCRIPTION ============================ BASEMENT from PSB2 Given a vector of integers, return the first index such that the sum of all integers from the start of the vector to that index (inclusive) is negative.
Public variables and functions:
propeller.problems.PSB2.bouncing-balls
=========== PROBLEM DESCRIPTION =============================== BOUNCING BALLS from PSB2 Given a starting height and a height after the first bounce of a dropped ball, calculate the bounciness index (height of first bounce / starting height). Then, given a number of bounces, use the bounciness index to calculate the total distance that the ball travels across those bounces.
Public variables and functions:
propeller.problems.PSB2.bowling
=========== PROBLEM DESCRIPTION ====================== BOWLING from PSB2 Given a string representing the individual bowls in a 10-frame round of 10 pin bowling, return the score of that round.
Public variables and functions:
propeller.problems.PSB2.camel-case
=========== PROBLEM DESCRIPTION ===================================== CAMEL CASE from PSB2 Take a string in kebab-case and convert all of the words to camelCase. Each group of words to convert is delimited by "-", and each grouping is separated by a space. For example: "camel-case example-test-string" → "camelCase exampleTestString"
Public variables and functions:
propeller.problems.PSB2.dice-game
=========== PROBLEM DESCRIPTION =============================== DICE GAME from PSB2 Peter has an n sided die and Colin has an m sided die. If they both roll their dice at the same time, return the probability that Peter rolls strictly higher than Colin.
Public variables and functions:
propeller.problems.PSB2.fizz-buzz
=========== PROBLEM DESCRIPTION ========================= 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.fuel-cost
=========== PROBLEM DESCRIPTION ========================= FUEL COST from PSB2 Given a vector of positive integers, divide each by 3, round the result down to the nearest integer, and subtract 2. Return the sum of all of the new integers in the vector
Public variables and functions:
propeller.problems.PSB2.gcd
=========== PROBLEM DESCRIPTION =============================== GCD [GREATEST COMMON DIVISOR] from PSB2 Given two integers, return the largest integer that divides each of the integers evenly
Public variables and functions:
propeller.problems.PSB2.luhn
=========== PROBLEM DESCRIPTION ============================ LUHN from PSB2 Given a vector of 16 digits, implement Luhn’s algorithm to verify a credit card number, such that it follows the following rules: double every other digit starting with the second digit. If any of the results are over 9, subtract 9 from them. Return the sum of all of the new digits.
Public variables and functions:
propeller.problems.PSB2.middle-character
=========== PROBLEM DESCRIPTION ============================= MIDDLE CHARACTER from PSB2 Given a string, return the middle character as a string if it is odd length; return the two middle characters as a string if it is even length.
Public variables and functions:
propeller.problems.PSB2.paired-digits
=========== PROBLEM DESCRIPTION ============================= PAIRED DIGITS from PSB2 Given a string of digits, return the sum of the digits whose following digit is the same.
Public variables and functions:
propeller.problems.PSB2.shopping-list
=========== PROBLEM DESCRIPTION =============================== DICE GAME from PSB2 Peter has an n sided die and Colin has an m sided die. If they both roll their dice at the same time, return the probability that Peter rolls strictly higher than Colin.
Public variables and functions:
propeller.problems.PSB2.snow-day
=========== PROBLEM DESCRIPTION =============================== SNOW DAY from PSB2 Given an integer representing a number of hours and 3 floats representing how much snow is on the ground, the rate of snow fall, and the proportion of snow melting per hour, return the amount of snow on the ground after the amount of hours given. Each hour is considered a discrete event of adding snow and then melting, not a continuous process.
Public variables and functions:
propeller.problems.PSB2.solve-boolean
=========== PROBLEM DESCRIPTION ================================ SOLVE BOOLEAN from PSB2 Given a string representing a Boolean expression consisting of T, F, |, and &, evaluate it and return the resulting Boolean.
Public variables and functions:
propeller.problems.PSB2.spin-words
=========== PROBLEM DESCRIPTION ============================== SPIN WORDS from PSB2 Given a string of one or more words (separated by spaces), reverse all of the words that are five or more letters long and return the resulting string.
Public variables and functions:
propeller.problems.PSB2.square-digits
=========== PROBLEM DESCRIPTION ========================= SQUARE DIGITS from PSB2 Given a positive integer, square each digit and concatenate the squares into a returned string.
Public variables and functions:
propeller.problems.PSB2.substitution-cipher
=========== PROBLEM DESCRIPTION ========================= SUBSTITUTION CIPHER from PSB2 This problem gives 3 strings. The first two represent a cipher, mapping each character in one string to the one at the same index in the other string. The program must apply this cipher to the third string and return the deciphered message.
Public variables and functions:
propeller.problems.PSB2.twitter
=========== PROBLEM DESCRIPTION ============================= 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.simple-regression
=========== PROBLEM DESCRIPTION ============================= Simple Regression: Given inputs and outputs, find the target function. ===============================================================
Public variables and functions:
propeller.problems.string-classification
=========== PROBLEM DESCRIPTION ============================= String Classification: Given a string, return true if it contains A, C, G, and T. Else return false. ===============================================================
Public variables and functions: