Пример #1
0
    def test_payoff1(self):
        party = Party('party', ['@A', '@B', '@C'])
        party.waste('@A', 150)
        party.waste('@B', 150)
        expected = [('@C', '@A', 50), ('@C', '@B', 50)]

        self.assertEqual(party.payoff(), expected)
Пример #2
0
    def test_payoff3(self):
        party = Party('party', ['@A', '@B', '@C', '@D'])
        party.waste('@A', 2000)
        party.waste('@B', 1000)
        party.waste('@C', 1000)
        expected = [('@D', '@A', 1000.0)]

        self.assertEqual(party.payoff(), expected)
Пример #3
0
    def test_payoff4(self):
        party = Party('party',
                      ['@A', '@B', '@C', '@D', '@E', '@F', '@G', '@H'])
        party.waste('@A', 11000)
        party.waste('@B', 11000)
        party.waste('@C', 1000)
        party.waste('@D', 1500)
        expected = [('@E', '@A', 3062.5), ('@F', '@A', 3062.5),
                    ('@G', '@A', 1812.5), ('@G', '@B', 1250.0),
                    ('@H', '@B', 3062.5), ('@C', '@B', 2062.5),
                    ('@D', '@B', 1562.5)]

        self.assertEqual(party.payoff(), expected)
Пример #4
0
 def test_payoff5(self):
     party = Party('party', ['@A', '@B', '@C', '@D'])
     party.waste('@A', 1000)
     party.waste('@B', 500)
     party.waste('@C', 250)
     party.waste('@D', 100)
     expected = [('@D', '@A', 362.5), ('@C', '@A', 175.0),
                 ('@C', '@B', 37.5)]
     self.assertEqual(party.payoff(), expected)
Пример #5
0
    def test_payoff_not_dividable(self):
        party = Party('party', ['@A', '@B', '@C'])
        party.waste('@A', 100)
        expected = [('@B', '@A', 33.33), ('@C', '@A', 33.33)]

        self.assertEqual(party.payoff(), expected)