def test_mmlhs(self): lh = LatinHypercube(rand_latin_hypercube(10,2), 2, 1) phi1 = lh.mmphi() lh_opt = _mmlhs(lh, 20, 20) opt_phi = lh_opt.mmphi() self.assertTrue(is_latin_hypercube(lh_opt)) self.assertTrue(opt_phi < phi1)
def _get_input_values(self): rand_doe = rand_latin_hypercube(self.num_sample_points, self.num_parameters) best_lhc = LatinHypercube(rand_doe, q=1, p=_norm_map[self.norm_method]) for q in self.qs: lh = LatinHypercube(rand_doe, q, _norm_map[self.norm_method]) lh_opt = _mmlhs(lh, self.population, self.generations) if lh_opt.mmphi() < best_lhc.mmphi(): best_lhc = lh_opt for row in best_lhc: yield row