 
                 (seq (sources-by-type :bottom-up-action))
                 (if directed?
-                  (add-directed-actions s (apply min-key tsi sources) var->cluster cluster-sgs dtgs cc-map acyclic-succ-fn)
+                  (add-directed-actions s (apply min-key tsi sources) var->cluster cluster-sgs dtgs ac-map cc-map acyclic-succ-fn teleport-fn)
                   (add-actions s (apply min-key tsi sources) var->cluster cluster-sgs))               
                      
                 (seq (sources-by-type :bottom-up-activate))

       Greedy means we forget about reserving preconditions when free and we can fire right now (less branching).
       Sloppy means we ignore if preconditions are free, but require no action on them.
       Extra-sloppy means anything goes -- if you can execute ignoring commitments, go for it."
  ([sas-problem & {:keys [directed? greedy? deadlock? dead-vars? components?] :as m
                   :or   {directed? true greedy? true deadlock? true dead-vars? true components? false}}]
     (assert (every? #{:directed? :greedy? :deadlock? :dead-vars? :components?} (keys m)))
     (let [edge-rule     (if greedy? :greedy :naive)
           cluster-cg    (remove #(apply = %) (sas-analysis/effect-clustered-causal-graph sas-problem))
           clusters      (graphs/ancestor-set cluster-cg [#{sas/goal-var-name}])

;; TODO: "state abstraction" here for single clusters.
;; TODO: can we provide some notion of relevance/directedness within a cluster?
;;       i.e., may have actions affecting A & B or B & C.  If precond on C, ... ?
(defn add-directed-actions [s c var->cluster cluster-sgs dtgs acm ccm acyclic-succ-fn teleport-fn]
  (if-let [v (util/singleton c)]
    (let [c-val (state/get-var s v)
          dtg   (get-in dtgs [v c-val])
          child (current-child s ccm c)
          d-val (-> (state/get-var s (action-var child)) :precond-map (get v))]
      (if d-val 
        (cond (= c-val d-val)
              [(make-freeze-var-action c)]

              (and teleport-fn (= 1 (count (acm c))))
              (when-let [teleport (teleport-fn v c-val d-val)]
                [teleport])

              :else 
              (for [n-val (acyclic-succ-fn v c-val d-val), a (dtg n-val)]
                (make-add-action-action var->cluster a)))
        (add-actions s c var->cluster cluster-sgs))) ;; only for cyclic domains -- TODO: remove?
    (let [child-action (state/get-var s (action-var (current-child s ccm c)))
          restricted-pm (select-keys (:precond-map child-action) c)]
