def _test_mmlhs_latin(self, n, k):
        p = 1
        population = 3
        generations = 6

        test_lhc = _rand_latin_hypercube(n, k)
        best_lhc = _LHC_Individual(test_lhc, 1, p)
        mmphi_initial = best_lhc.mmphi()
        for q in (1, 2, 5, 10, 20, 50, 100):
            lhc_start = _LHC_Individual(test_lhc, q, p)
            lhc_opt = _mmlhs(lhc_start, population, generations)
            if lhc_opt.mmphi() < best_lhc.mmphi():
                best_lhc = lhc_opt

        self.assertTrue(
                best_lhc.mmphi() < mmphi_initial,
                "'_mmlhs' didn't yield lower phi. Seed was {}".format(self.seedval))
Example #2
0
    def _test_mmlhs_latin(self, n, k):
        p = 1
        population = 3
        generations = 6

        test_lhc = _rand_latin_hypercube(n, k)
        best_lhc = _LHC_Individual(test_lhc, 1, p)
        mmphi_initial = best_lhc.mmphi()
        for q in (1, 2, 5, 10, 20, 50, 100):
            lhc_start = _LHC_Individual(test_lhc, q, p)
            lhc_opt = _mmlhs(lhc_start, population, generations)
            if lhc_opt.mmphi() < best_lhc.mmphi():
                best_lhc = lhc_opt

        self.assertTrue(
                best_lhc.mmphi() < mmphi_initial,
                "'_mmlhs' didn't yield lower phi. Seed was {}".format(self.seedval))
    def test_rand_latin_hypercube(self):
        for n, k in self.hypercube_sizes:
            test_lhc = _rand_latin_hypercube(n, k)

            self.assertTrue(_is_latin_hypercube(test_lhc))
    def test_rand_latin_hypercube(self):
        for n, k in self.hypercube_sizes:
            test_lhc = _rand_latin_hypercube(n, k)

            self.assertTrue(_is_latin_hypercube(test_lhc))