Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify evolve function

  • Loading branch information...
commit 838c4d7cbbafc1c9ac2773358430857bdcedab1b 1 parent fa2a939
@danielstockton authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/evolve/core.clj
View
4 src/evolve/core.clj
@@ -18,8 +18,8 @@
(defn evolve
[source fitness]
(first
- (filter #(<= (fitness %) (fitness source))
- (iterate mutate source))))
+ (filter #(or (<= (fitness %) (fitness source)) (= (fitness %) 0))
+ (repeatedly #(mutate source)))))
(defn start
[generations source target]
Please sign in to comment.
Something went wrong with that request. Please try again.