def normalize_qvalue(q)
      (q == 1 || q == 0) && q.is_a?(Float) ? q.to_i : q
    end
def normalize_qvalue(q)
      (q == 1 || q == 0) && q.is_a?(Float) ? q.to_i : q
    end
Converts 1.0 and 0.0 qvalues to 1 and 0 respectively. Used to maintain
 consistency across qvalue methods.