def atest_stochastic_universal_sampling(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0,0,1,3,3,4] solutions = self.resample(indices) dautils.stochasticUniversalSampling(self.resamplingDrifterSet, self.resamplingVar) assert2DListAlmostEqual(self, self.resamplingDrifterSet.getDrifterPositions().tolist(), solutions, 2, "stochastic universal sampling, probabilistic duplicates")
def atest_stochastic_universal_sampling_with_duplicates(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0, 0, 1, 3, 3, 4] solutions = self.resample(indices) dautils.stochasticUniversalSampling(self.resamplingDrifterSet) self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \ solutions)
def atest_stochastic_universal_sampling_with_duplicates(self): self.set_positions_resampling_set() setNpRandomSeed() indices = [0,0,1,3,3,4] solutions = self.resample(indices) dautils.stochasticUniversalSampling(self.resamplingDrifterSet) self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \ solutions)