 		(assoc! new-state-var-map effect-var 
 			(map-linear-expr-vars old-state-var-map effect-lm)))
 	      (transient old-state-var-map) effects))
-     (increment-lp-objective lp (map-linear-expr-vars old-state-var-map reward)))))
+     (increment-lp-objective lp (dissoc reward nil))
+     (+ (get-reward-const state) (get reward nil 0)))))
 
 
 

   maximal reward."
  [state]
  (let [[var-map rew] (lp/solve-incremental-lp (get-incremental-lp state))]
    (assert (== 1 (get var-map nil)))
    [(map-vals (fn [lm] (evaluate-linear-expr var-map lm))
	       (get-state-var-map state))
     (dissoc var-map nil)
     rew]))





(defn make-lp-state 
  "Take a concrete assignment from all state variables to numeric values, and make a fresh
   lp-state.  nil acts like a special lp parameter, set to unity."
  [initial-state-map]
;  (assert (every? vector? (keys initial-state-map)))
  (make-lp-state* 
   (map-vals #(hash-map nil %) initial-state-map)
   (lp/make-incremental-lp {} {} {})
   0))

(defn add-lp-state-param 
  "Add a new parameter to the LP, with optional bounds.  If no bounds give, param will start unbounded."
