   (hierarchical-search henv (if-cycle-fn :transparent :recursive-exhaustive) 
     (comp make-exhaustive-search make-incremental-dijkstra-sa-search)))
 
+
 (defn sahucs-flat [henv]
   (hierarchical-search henv (constantly :transparent)
     make-incremental-dijkstra-sa-search))

  (expand-node        [se new-threshold]
    "Returns PartialResult of SearchNodes."))



(deftype GoalNode [goal-state]
  SearchNode
  (extract-goal-state []           goal-state)
  (expand-node        [min-reward] (throw (UnsupportedOperationException.))))

;; Named node is simple non-terminal node whose equality semantics are given by name.
(deftype NamedNode [name root-sa expand-fn] :as this

                (let [next-min-reward (max min-reward (queue-best-reward queue))]
                  (queues/pq-replace! partial-queue best (make-queue-priority best-reward))
                  (let [{:keys [result-pairs max-reward]} (expand-fn best next-min-reward)]
                    (if (= max-reward Double/NEGATIVE_INFINITY) 
                        (queues/pq-remove! partial-queue best)
                      (queues/pq-replace! partial-queue best (make-queue-priority max-reward)))
                    (doseq [[ni nr] result-pairs] 
 ;                    (println "NEW" max-reward (class ni) nr (:name ni))
                      (assert (not (= :re-added (queues/pq-add! new-queue ni (make-queue-priority nr))))))
