Esempio n. 1
0
    def test003(self):
        random.seed(2)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)

        self.assertAlmostEqual(mobius.sum(), 1)
    def test003(self):
        random.seed(2)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)

        self.assertAlmostEqual(mobius.sum(), 1)
Esempio n. 3
0
    def test005(self):
        random.seed(4)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c, 2)
        mobius = capacities_to_mobius(c, capacities)

        self.assertAlmostEqual(mobius.sum(), 1)
        self.assertTrue(capacities_are_monotone(c, capacities))
        self.assertAlmostEqual(capacities.max(), 1)
    def test005(self):
        random.seed(4)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c, 2)
        mobius = capacities_to_mobius(c, capacities)

        self.assertAlmostEqual(mobius.sum(), 1)
        self.assertTrue(capacities_are_monotone(c, capacities))
        self.assertAlmostEqual(capacities.max(), 1)
Esempio n. 5
0
    def test001(self):
        random.seed(4)
        c = generate_criteria(3)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)
        capacities2 = mobius_to_capacities(c, mobius)

        mobius_truncate(mobius, 2)

        self.assertEqual(capacities, capacities2)
    def test001(self):
        random.seed(4)
        c = generate_criteria(3)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)
        capacities2 = mobius_to_capacities(c, mobius)

        mobius_truncate(mobius, 2)

        self.assertEqual(capacities, capacities2)
Esempio n. 7
0
    def test004(self):
        random.seed(3)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)
        mobius_truncate(mobius, 2)
        mobius.normalize_sum_to_unity()
        capacities2 = mobius_to_capacities(c, mobius)

        self.assertAlmostEqual(mobius.sum(), 1)
        self.assertTrue(capacities_are_monotone(c, capacities2))
        self.assertAlmostEqual(capacities2.max(), 1)
    def test004(self):
        random.seed(3)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)
        mobius = capacities_to_mobius(c, capacities)
        mobius_truncate(mobius, 2)
        mobius.normalize_sum_to_unity()
        capacities2 = mobius_to_capacities(c, mobius)

        self.assertAlmostEqual(mobius.sum(), 1)
        self.assertTrue(capacities_are_monotone(c, capacities2))
        self.assertAlmostEqual(capacities2.max(), 1)
Esempio n. 9
0
    def test002(self):
        random.seed(1)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)

        self.assertTrue(capacities_are_monotone(c, capacities))
    def test002(self):
        random.seed(1)
        c = generate_criteria(10)
        capacities = generate_random_capacities(c)

        self.assertTrue(capacities_are_monotone(c, capacities))