julius383 / genarith

Genetic Algorithm for Guessing Expressions in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Genetic Algorithm for Guessing Expressions

Try and guess an expression such as 4 * 5 when given input of a number such as 20. I wrote an article describing this project.

Installing

  1. clone this repo
  2. cd into directory
  3. start julia repl and enter package mode with ]
  4. run activate . to activate project
  5. install dependencies with instantiate
  6. in shell run sqlite3 data.db < db.sql to create table for saving stats

Running

Include genarith.jl into the repl and run the ga function with target = somevalue. Optionally uncomment the last few lines of genarith.jl to be able to do julia --project genarith.jl somevalue to run the program from the CLI.

About

Genetic Algorithm for Guessing Expressions in Julia

License:MIT License


Languages

Language:Julia 100.0%