From a48ce0bcd2df854c58231f68aef93a7f9d065bd6 Mon Sep 17 00:00:00 2001 From: Laverne Schrock Date: Wed, 6 Jul 2016 10:09:46 -0500 Subject: [PATCH] Add a run UUID to the push-argmap Placing the UUID in the argmap allows it to easily be accessed from various locations. --- src/clojush/pushgp/pushgp.clj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clojush/pushgp/pushgp.clj b/src/clojush/pushgp/pushgp.clj index 808c1fc7c..c40d7e4fc 100644 --- a/src/clojush/pushgp/pushgp.clj +++ b/src/clojush/pushgp/pushgp.clj @@ -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 @@ -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])