Added resampling to JPF agent.