Skip to content

Instantly share code, notes, and snippets.

@jal278
jal278 / ga.py
Created Dec 22, 2011
Simple ga
View ga.py
#### Simple genetic algorithm
#### Joel Lehman
import random
errors=[]
def equation_error(x):
left_side = 2.0*x-10.0
right_side = 3.0
return abs(left_side-right_side)