Skip to content

Commit

Permalink
Add a run UUID to the push-argmap
Browse files Browse the repository at this point in the history
Placing the UUID in the argmap allows it to easily be accessed from
various locations.
  • Loading branch information
Laverne Schrock committed Jul 6, 2016
1 parent bf49823 commit a48ce0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/clojush/pushgp/pushgp.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:use-single-thread false ;; When true, Clojush will only use a single thread
:random-seed (random/generate-mersennetwister-seed) ;; The seed for the random number generator
:save-initial-population false ;; When true, saves the initial population
:run-uuid nil ;; This will be set to a new type 4 pseudorandom UUID on every run
;;
;;----------------------------------------
;; Standard GP arguments
Expand Down Expand Up @@ -144,6 +145,7 @@
(doseq [[argkey argval] argmap]
(assert (contains? @push-argmap argkey) (str "Argument key " argkey " is not a recognized argument to pushgp."))
(swap! push-argmap assoc argkey argval))
(swap! push-argmap assoc :run-uuid (java.util.UUID/randomUUID))
(when (:autoconstructive @push-argmap)
(swap! push-argmap assoc :genetic-operator-probabilities {:autoconstruction 1.0})
(swap! push-argmap assoc :epigenetic-markers [:close :silent])
Expand Down

0 comments on commit a48ce0b

Please sign in to comment.