def getlastsolution(prob: Optimization): new_index = prob.firstavailableindex(prob.getSolSet()) return prob.getSol(new_index - 1)