https://github.com/danielholmes/genetic-algorithm-equation
Evolving equations to match a target number
https://github.com/danielholmes/genetic-algorithm-equation
Last synced: 11 months ago
JSON representation
Evolving equations to match a target number
- Host: GitHub
- URL: https://github.com/danielholmes/genetic-algorithm-equation
- Owner: danielholmes
- Created: 2016-09-03T03:37:16.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-11T22:30:27.000Z (almost 10 years ago)
- Last Synced: 2025-02-10T01:41:28.240Z (over 1 year ago)
- Language: Scala
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Genetic Algorithm Equation
An implementation of the the problem outlined here: (http://www.ai-junkie.com/ga/intro/gat1.html). i.e.
Given the digits 0 through 9 and the operators +, -, * and /, find a sequence that will represent a given target
number. The operators will be applied sequentially from left to right as you read.
## Dependencies
- SBT
- JDK 8+
- Scala 2.11
To find available SBT dependency updates run `sbt dependencyUpdates`
## Tests
- All: `sbt test`
- Individual: `sbt "test-only org.danielholmes.gaeq.GeneEncoderSpec"`
- Individual continuous: `sbt ~"test-only org.danielholmes.gaeq.GeneEncoderSpec"`
## Running
`sbt 'run-main org.danielholmes.gaeq.Run'`
## Encoding
| value | gene |
|-------|------|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
| + | 1010 |
| - | 1011 |
| * | 1100 |
| / | 1101 |
Unused/Ignored Genes: 1110 1111