Example #1
0
 def atest_residual_sampling(self):
     self.set_positions_resampling_set()
     setNpRandomSeed()
     indices = [0,0,3,3,1,4]
     solutions = self.resample(indices)
     dautils.residualSampling(self.resamplingDrifterSet, self.resamplingVar)
     assert2DListAlmostEqual(self, self.resamplingDrifterSet.getDrifterPositions().tolist(), solutions, 2, "residual sampling, probabilistic duplicates")
Example #2
0
 def atest_residual_sampling(self):
     self.set_positions_resampling_set()
     setNpRandomSeed()
     indices = [0,0,3,3,1,4]
     solutions = self.resample(indices)
     dautils.residualSampling(self.resamplingDrifterSet, self.resamplingVar)
     assert2DListAlmostEqual(self, self.resamplingDrifterSet.getDrifterPositions().tolist(), solutions, 2, "residual sampling, probabilistic duplicates")
Example #3
0
 def atest_residual_sampling_with_duplicates(self):
     self.set_positions_resampling_set()
     setNpRandomSeed()
     indices = [0, 0, 3, 3, 1, 4]
     solutions = self.resample(indices)
     dautils.residualSampling(self.resamplingDrifterSet)
     self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \
                      solutions)
Example #4
0
 def atest_residual_sampling_with_duplicates(self):
     self.set_positions_resampling_set()
     setNpRandomSeed()
     indices = [0,0,3,3,1,4]
     solutions = self.resample(indices)
     dautils.residualSampling(self.resamplingDrifterSet)
     self.assertEqual(self.resamplingDrifterSet.getDrifterPositions().tolist(), \
                      solutions)