    Reward is another linear combination term that will be added to the reward."  
   [state effects reward]
   (let [old-state-var-map (get-state-var-map state)
-	lp                (get-incremental-lp state)]
+	lp                (get-incremental-lp state)
+	reward            (map-linear-expr-vars old-state-var-map reward)]
     (make-lp-state* 
      (persistent!
       (reduce (fn [new-state-var-map [effect-var effect-lm]]




(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]))
  
	    


		(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 (dissoc reward nil))
     (+ (get-reward-const state) (get reward nil 0)))))



