   (:require
     #_[om.core :as om :include-macros true]
     [clojure.set :refer [union]]
-    [clojure.walk :as walk]
+    #_[clojure.walk :as walk]
     [sablono.core :as sab :include-macros true])
   (:require-macros
-    [devcards.core :as dc :refer [defcard deftest]]))
+    [devcards.core :refer [defcard deftest]]))
 
 (enable-console-print!)
 

           (ha-states @scene))
         scene-a)

(defn scene-widget [scene owner]
  (let [scale 2
        view-h (str (* scale 240) "px")
        ct (count (:objects @scene))
        line-h (/ (* scale 240) ct)]
    (sab/html [:div {:style {:backgroundColor "blue" :width (str (* scale 320) "px") :height view-h :position "relative"}}
               (map (fn [{x :x y :y w :w h :h :as ha} i]
                      (let [trans-count (count (required-transitions ha))
                            trans-h (/ line-h trans-count)]
                        [:div

        v2k (if (= (count simple-guard) 4) (third simple-guard) nil)
        [v10 v1f] (get-var-and-flow has ha v1k)
        [v20 v2f] (get-var-and-flow has ha v2k)
        sat (guard-satisfied? rel v10 v20 c)
        #_ _ #_(println (str "(" v10 " + " v1f "t) - (" v20 " + " v2f "t) "
             (case rel :gt ">" :geq ">=" :leq "<=" :lt "<") " " c))
        ; by algebra: A0+fA*dt-B0-fB*dt-C~0 --> (fA-fB)*dt ~ (-A0 + B0 + C) --> dt ~ (-A0 + B0 + C)/(fA-fB)
        denom (- v1f v2f)
        rhs (if (= denom 0)
              Infinity
              (/ (+ (- v10) v20 c)
                 denom))
        ; since we are dividing by denom, flip rel if denom (a constant) < 0
        rel (if (> denom 0)
              rel
              (case rel
                :gt :lt
                :geq :leq
                :leq :geq
                :lt :gt))
        ; t REL rhs
        entry-time (:entry-time ha)
        ;_ (println (:id ha) simple-guard "et" entry-time "push up" time-unit rhs "to" (+ entry-time time-unit) (+ entry-time rhs) "sat?" sat)
        min-t (+ entry-time time-unit)
        rhs (+ entry-time rhs)]
    (assert (not (nil? v10))
