 (defn tournament-selection
   "Returns an individual that does the best out of a tournament."
   [pop location {:keys [tournament-size total-error-method]}]
-  (let [tournament-set 
-        (doall
-          (for [_ (range tournament-size)]
-            (lrand-nth pop)))
+  (let [subpop (age-mediate pop argmap)
+        tournament-set (doall
+                         (for [_ (range tournament-size)]
+                           (lrand-nth subpop)))
         err-fn (case total-error-method
                  :sum :total-error
                  (:hah :rmse :ifs) :weighted-error

(defn elitegroup-lexicase-selection
  "Returns an individual produced by elitegroup lexicase selection."
  [pop]
  (loop [survivors (retain-one-individual-per-error-vector pop)
         cases (lshuffle (map lrand-nth @elitegroups))]
    (if (or (empty? cases)
            (empty? (rest survivors)))

                                                               (inc sel-count)))))
    selected))

