Skip to content

Commit

Permalink
Merge de35704 into 9f3ab40
Browse files Browse the repository at this point in the history
  • Loading branch information
thelmuth committed Jun 29, 2017
2 parents 9f3ab40 + de35704 commit e016128
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/clojush/pushgp/selection/tournament.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
(:hah :rmse :ifs) :weighted-error
(throw (Exception. (str "Unrecognized argument for total-error-method: "
total-error-method))))]
(reduce (fn [i1 i2] (if (< (err-fn i1) (err-fn i2)) i1 i2))
tournament-set)))
(apply min-key err-fn tournament-set)))
4 changes: 2 additions & 2 deletions src/clojush/pushstate.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"Returns a copy of the state with the value pushed on the named stack. This is a utility,
not for use in Push programs."
[value type state]
(assoc state type (cons value (type state))))
(update state type conj value))

(defn top-item
"Returns the top item of the type stack in state. Returns :no-stack-item if called on
Expand Down Expand Up @@ -93,7 +93,7 @@
"Returns a copy of the state with the specified stack popped. This is a utility,
not for use as an instruction in Push programs."
[type state]
(assoc state type (rest (type state))))
(update state type rest))

(defn end-environment
"Ends the current environment by popping the :environment stack and replacing
Expand Down

0 comments on commit e016128

Please sign in to comment.