modified calc_next_reaction function in GillespieSimulator