   [dtgs]
   (into {} (for [[var dtg] dtgs] [var (compute-var-possible-next-map var dtg)])))
 
-(deftype ASPlanHierarchy [sas-problem vars dtgs parent-var-map possible-next-map])
-(defn make-asplan-hierarchy [sas-problem dtgs] 
+(deftype ASPlanFlatHierarchy [sas-problem vars dtgs parent-var-map possible-next-map])
+
+(defn make-asplan-flat-hierarchy [sas-problem dtgs] 
   (let [causal-graph (remove #(apply = %) (sas-analysis/standard-causal-graph sas-problem))
         parent-var-map (util/map-vals #(map second %) (util/group-by first causal-graph))]
     (assert (graphs/dag? causal-graph))
-    {:type              ::ASPlanHierarchy
-     :sas-problem       sas-problem
-     :vars              (keys (:vars sas-problem))
-     :dtgs              dtgs
-     :parent-var-map    parent-var-map 
-     :possible-next-map (compute-possible-next-map dtgs)}))
+    (ASPlanFlatHierarchy
+     sas-problem 
+     (keys (:vars sas-problem))
+     dtgs
+     parent-var-map
+     (compute-possible-next-map dtgs))))
 
 (defn make-asplan-env [sas-problem dtgs]
   (reify env/Env

; (use '[exp env hierarchy taxi-infinite ucs asplan hierarchical-incremental-search] 'edu.berkeley.ai.util)
; (let [e (make-random-infinite-taxi-sas2 1 2 1 2)] (println (run-counted #(uniform-cost-search e))) (println (run-counted #(asplan-solution-pair-name (debug 0 (sahucs-fast-flat (make-asplan-henv e )))))))


               false)
         (can-use-next? hierarchy effect-var eval p (env/get-var s p))))
     ((util/safe-get hierarchy :parent-var-map) effect-var))))

;; TODO: should not add actinos if only current val can be needed.

(deftype ActivateVarHLA [hierarchy effect-var]
  env/Action
