res.addState(qnew);
stateMapper.put(qnewid, qnew);
// update new state's weight
Float fw = qnew.getFinalWeight();
for (Pair<State, Float> ps : forQueue) {
fw = semiring.plus(fw, semiring.times(ps.getLeft()
.getFinalWeight(), ps.getRight()));
}
qnew.setFinalWeight(fw);
queue.add(forQueue);