示例#1
0
 def testUniform1(self):
     dist = uniform()
     v = 0.75
     w = 0.3
     expected = ([1,0],[0.5,0])
     bids = [v,w]
     distributions = [dist,dist]
     obtained = myersonAuction(bids,distributions)
     self.iterableAssertAlmostEqual(expected, obtained, 
                            msg="Myerson auction with inputs: " + str(bids) + ", " +
                                  str(distributions) + ". Expected " + str(expected) + 
                                 "but obtained " + str(obtained) + ".")
示例#2
0
 def testExponential1(self):
     distV = expon(scale=5)
     distW = expon(scale=3)
     v = 2
     w = 3
     expected = ([0,1],[0,3])
     bids = [v,w]
     distributions = [distV,distW]
     obtained = myersonAuction(bids,distributions)
     self.assertAlmostEqual(expected, obtained, 
                            msg="Myerson auction with inputs: " + str(bids) + ", " +
                                  str(distributions) + ". Expected " + str(expected) + 
                                 "but obtained " + str(obtained) + ".")
示例#3
0
 def testUniform4(self):
     distV = uniform()
     distW = uniform(scale=2)
     v = 0.7
     w = 1.4
     expected = ([0,1],[0,1.2])
     bids = [v,w]
     distributions = [distV,distW]
     obtained = myersonAuction(bids,distributions)
     self.assertAlmostEqual(expected, obtained, 
                            msg="Myerson auction with inputs: " + str(bids) + ", " +
                                  str(distributions) + ". Expected " + str(expected) + 
                                 "but obtained " + str(obtained) + ".")