 
 ; Ideally, should prefer top-most top-down, bottom-most bottom-up, or something...
 
-(deftype GASPlanEnv [init actions-fn g-map]
+(defrecord GASPlanEnv [init actions-fn g-map]
   env/Env 
-    (initial-state [_] init)
-    (actions-fn    [] actions-fn)
-    (goal-fn       [] #(when (state/state-matches-map? % g-map) (env/solution-and-reward %)))
+    (initial-state [this] init)
+    (actions-fn    [this] actions-fn)
+    (goal-fn       [this] #(when (state/state-matches-map? % g-map) (env/solution-and-reward %)))
   env/FactoredEnv
-    (goal-map      [] g-map))
+    (goal-map      [this] g-map))
 
 (defn make-gasplan-env [sas-problem] 
   (def *add-count* (util/sref 0))

               (every? #(state/get-var s (parent-var % effect-var)) unfree-pv))
        (util/assert-is (every? #(nil? (state/get-var s (action-var %))) precond-vars) ); "%s" [name effect-var (println s)])
        (util/assert-is (every? #(nil? (state/get-var s (action-var %))) effect-vars))        
        (env/env-util/make-factored-primitive
         [::GreedyFire name]
         (into precond-map 
               (concat [[(action-var effect-var) factored-primitive]]

(ns angelic.search.action-set.gasplan
  (:require [edu.berkeley.ai.util :as util]
            [edu.berkeley.ai.util.graphs :as graphs]
            [angelic.env :as env]
            [angelic.env.util :as env-util]
            [angelic.env.state :as state]
            [angelic.hierarchy :as hierarchy]
            [angelic.sas :as sas]
            [angelic.sas.analysis :as sas-analysis])
  (:import [java.util HashMap]))


