Skip to content

Instantly share code, notes, and snippets.

@jal278
jal278 / ga.py
Created December 22, 2011 17:35
Simple ga
#### 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)