Skip to content

Commit

Permalink
Merge branch 'problem/pxkelly-benchmarks-2021' into problem/developin…
Browse files Browse the repository at this point in the history
…g-benchmarks-2021
  • Loading branch information
thelmuth committed Jan 16, 2021
2 parents 7aeec45 f54e725 commit 9b70529
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 20 deletions.
10 changes: 6 additions & 4 deletions src/clojush/problems/software/benchmarks_v2/camel_case.clj
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 122,10 @@
(println (format "\n| Correct output: %s\n| Program output: %s" (pr-str correct-output) (pr-str result))))
; Record the behavior
(swap! behavior conj result)
; Error is Levenshtein distance for printed string
(levenshtein-distance correct-output (str result))
; Error is Levenshtein distance
(if (string? result)
(levenshtein-distance correct-output (str result))
10000) ; penalty for no return value
)))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
Expand Down Expand Up @@ -184,5 186,5 @@
:problem-specific-initial-report camel-case-initial-report
:report-simplifications 0
:final-report-simplifications 5000
:max-error 1000000
})
:max-error 10000
})
12 changes: 6 additions & 6 deletions src/clojush/problems/software/benchmarks_v2/cut_vector.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 31,7 @@
(defn cut-vector-input
"Makes a Cut Vector input vector of length len."
[len]
(vec (repeatedly len #(rand-int 10000))))
(vec (repeatedly len #(rand-int 10001))))

; Atom generators
(def cut-vector-atom-generators
Expand All @@ -51,13 51,13 @@
;; inputs is either a list or a function that, when called, will create a
;; random element of the set.
(def cut-vector-data-domains
[[(list [0] [100] [-100] [1000] [-1000]) 5 0] ;; Length-1 vectors
[[(list [0] [10] [100] [1000] [10000]) 5 0] ;; Length-1 vectors
[(fn [] (cut-vector-input 1)) 20 250] ;; Random Length-1 vectors
[(list [2 129]
[1 -4]
[999 74]
[987 995]
[-788 -812]) 5 0] ;; Length-2 vectors
[0 40]
[9999 74]
[9879 9950]
[9225 9994]) 5 0] ;; Length-2 vectors
[(fn [] (cut-vector-input 2)) 20 250] ;; Random Length-2 vectors
[(fn [] (cut-vector-input ( 3 (lrand-int 3)))) 50 500] ;; Random Length-3, -4, and -5 vectors
[(fn [] (cut-vector-input 20)) 5 50] ;; Random Length-20 vectors
Expand Down
6 changes: 4 additions & 2 deletions src/clojush/problems/software/benchmarks_v2/fizz_buzz.clj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 101,9 @@
; Record the behavior
(swap! behavior conj result)
; Error is Levenshtein distance
(levenshtein-distance correct-output (str result))
(if (string? result)
(levenshtein-distance correct-output (str result))
10000) ; penalty for no return value
)))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
Expand Down Expand Up @@ -172,5 174,5 @@
:problem-specific-initial-report fizz-buzz-initial-report
:report-simplifications 0
:final-report-simplifications 5000
:max-error 1000000
:max-error 10000
})
8 changes: 5 additions & 3 deletions src/clojush/problems/software/benchmarks_v2/spin_words.clj
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 136,10 @@
(println (format "\n| Correct output: %s\n| Program output: %s" (str correct-output) (str result))))
; Record the behavior
(swap! behavior conj result)
; Error is Levenshtein distance for string
(levenshtein-distance correct-output (str result))
; Error is Levenshtein distance
(if (string? result)
(levenshtein-distance correct-output (str result))
10000) ; penalty for no return value
)))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
Expand Down Expand Up @@ -198,5 200,5 @@
:problem-specific-initial-report spin-words-initial-report
:report-simplifications 0
:final-report-simplifications 5000
:max-error 1000000
:max-error 10000
})
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 98,9 @@
; Record the behavior
(swap! behavior conj result)
; Error is Levenshtein distance
(levenshtein-distance correct-output (str result))
(if (string? result)
(levenshtein-distance correct-output (str result))
10000) ; penalty for no return value
))))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
Expand Down Expand Up @@ -169,5 171,5 @@
:problem-specific-initial-report substitution-cipher-initial-report
:report-simplifications 0
:final-report-simplifications 5000
:max-error 1000000
:max-error 10000
})
9 changes: 6 additions & 3 deletions src/clojush/problems/software/benchmarks_v2/twitter.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 85,11 @@
(println (format "| Correct output: %s\n| Program output: %s\n" (str correct-output) (str result))))
; Record the behavior
(swap! behavior conj result)
; Error is Levenshtein distance of printed strings
(levenshtein-distance correct-output (str result)))))]
; Error is Levenshtein distance
(if (string? result)
(levenshtein-distance correct-output (str result))
10000) ; penalty for no return value
)))]
(if (= data-cases :train)
(assoc individual :behaviors @behavior :errors errors)
(assoc individual :test-errors errors))))))
Expand Down Expand Up @@ -156,5 159,5 @@
:problem-specific-initial-report twitter-initial-report
:report-simplifications 0
:final-report-simplifications 5000
:max-error 1000000
:max-error 10000
})

0 comments on commit 9b70529

Please sign in to comment.