 (def argmap
   {:error-function (count-odds-error-function count-odds-data-domains)
    :atom-generators count-odds-atom-generators
-   :max-points 300
-   :max-points-in-initial-program 150
-   :evalpush-limit 600
+   :max-points 500
+   :max-points-in-initial-program 250
+   :evalpush-limit 1500
    :population-size 1000
    :max-generations 300
    :parent-selection :lexicase

      ([program data-cases print-outputs]
        (let [behavior (atom '())
              errors (doall
                       (for [[[input1 input2] correct-output] (case data-cases
                                                                           :train train-cases
                                                                           :test test-cases
                                                                           [])]
                         (let [final-state (run-push program
                                                     (->> (make-push-state)
                                                       (push-item input2 :input)
                                                       (push-item input1 :input)))
                               result (top-item :boolean final-state)]
                           (when print-outputs
                             (println (format "Correct output: %5b | Program output: %5b" correct-output result)))
                           ; Record the behavior
                           (when @global-print-behavioral-diversity
                             (swap! behavior conj result))
                           ; Error is boolean error
                           (if (= result correct-output)
                             0
                             1))))]
          (when @global-print-behavioral-diversity
            (swap! population-behaviors conj @behavior))
          errors)))))

;;Can make Count Odds test data like this:
;(test-and-train-data-from-domains count-odds-data-domains)

; Helper function for error function
(defn count-odds-test-cases
  "Takes a sequence of inputs and gives IO test cases of the form
   [input output]."
  [inputs]
  (map #(vector %
                (count (filter odd? %)))
       inputs))

; Define error function. For now, each run uses different random inputs
