             [clojure.core.matrix.random :as random]
             [taoensso.tufte :as tufte :refer (defnp p profiled profile)]))
 
-
-(defn get-random-sample [method properties & {:keys [centroids pos]}]
-  ;;TODO make this sample some actua; distributions....
-  (if centroids
-    (let [the-centroid (get centroids (rand-int (count centroids)))
-          {:keys [row col]} pos
-
-          ]
-      (n/noise2 (* row 0.1) (* col 0.25))
-      (vec
-        (map-indexed (fn [idx {:keys [::core/domain-start ::core/domain-end]}]
-                       (max domain-start (min domain-end (+ domain-start
-
-                                                            ;(rand (- domain-end domain-start))
-                                                            (+ (get the-centroid idx) (/ (first (random/sample-normal 1)) 10.0))
-                                                            ))))
-                     (::core/phase-space properties))))
-    (case method
-      :normal (vec
-                (map-indexed (fn [idx {:keys [::core/domain-start ::core/domain-end]}]
-                               (max domain-start (min domain-end (first (random/sample-normal 1)))))
-                             (::core/phase-space properties)))
-      :unifrom
-      (vec
-        (map-indexed (fn [idx {:keys [::core/domain-start ::core/domain-end]}]
-                       (max domain-start (min domain-end (+ domain-start (rand (- domain-end domain-start))))))
-                     (::core/phase-space properties))))
-    ))
-
-
-(def test-matrix
-  (->> (for [y (range 10) x (range 50)] (n/noise2 (* x 0.1) (* y 0.25)))
-       (viz/matrix-2d 50 10)))
-
 (defn grids-2d->heatmap-vec [grid-cells props & {:keys [clusters-only]}]
   (let [phase-space (::core/phase-space props)
         d1          (first phase-space)
         d2          (second phase-space)
         rows        (int (/ (- (::core/domain-end d1) (::core/domain-start d1)) (::core/domain-interval d1)))
         cols        (int (/ (- (::core/domain-end d2) (::core/domain-start d2)) (::core/domain-interval d2)))]
-
-    (println "rows, cols: " rows cols)
-
     (let [vecs
           (for [c (range cols) r (range rows)]
             (let [num (or

                                      ::core/initialized-clusters false}}

        _              (println "samples count: " (count samples))
        [{:keys [final-state state-ts]} prof-stats] (profiled {} (core/dstream-iterations test-state samples :state-append-every 100))
        final-grids    (::core/grid-cells final-state)
        sorted-stats   (take 3 (sort-by #(* -1 (:mean (second %))) (:id-stats-map prof-stats)))
        displayable    (display-state "final" test-props (::core/grid-cells final-state))]

  )


(defn sample-at-time [t time-intervals props]
  (hash-map
    ::core/raw-datum
    {::core/position-value
                  (vec (take (::core/dimensions props)
                             (repeatedly
                               (fn []
                                 (let [r (rand)]
                                   (cond (< t (int (/ time-intervals 2))) (+ 0.1
                                                                             (* 0.2
                                                                                (first
                                                                                  (random/sample-normal 1))))
                                         :else (-
                                                 (* 0.2
                                                    (first
                                                      (random/sample-normal 1)))
                                                 0.4)))))))
     ::core/value 1.0}))

(deftest stuff
  (let [test-props     {::core/c_m         3.0
