    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))
+    [(map-vals (fn [lm] (le/evaluate-linear-expr var-map lm))
 	       (get-state-var-map state))
-     (dissoc var-map nil)
-     rew]))
+     var-map
+     (+ rew (get-reward-const state))]))
 
 
 




(defn- constrain-lp-state [state constraint-lm bounds]
  (when-let [new-lp (add-lp-constraint 
		     (get-incremental-lp state)
		     [(le/map-linear-expr-vars (get-state-var-map state) constraint-lm) bounds])]
    (assoc state :incremental-lp new-lp)))
				       

(defn constrain-lp-state-gez 
  "Constrain constraint-lm linear-map to evaluate >= 0.  Return nil for inconsistent."
  [state constraint-lm]
  (constrain-lp-state state constraint-lm [0 nil]))

(defn constrain-lp-state-lez 
  "Constrain constraint-lm linear-map to evaluate <= 0.  Return nil for inconsistent."
  [state constraint-lm]
  (constrain-lp-state state constraint-lm [nil 0]))

(defn constrain-lp-state-eqz 
  "Constrain constraint-lm linear-map to evaluate = 0.  Return nil for inconsistent."
  [state constraint-lm]
  (constrain-lp-state state constraint-lm [0 0]))
  
	    



(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."
