Example #1
0
 def testDominance(self):
     hs = HotellingSimulator(10, 2)
     self.assertTrue(hs.parse("2 dominate? 1") == "strict")
     self.assertTrue(hs.parse("9 dominate? 10") == "strict")
Example #2
0
 def testParse(self):
     hs = HotellingSimulator(10, 2)
     self.assertTrue(hs.parse("u 1 1 1") == 50.0)
     self.assertTrue(hs.parse("u 2 1 1") == 50.0)
Example #3
0
 def testTwoCandidates(self):
     hs = HotellingSimulator(10, 2)
     self.assertTrue(hs.parse("u 1 2 8") == 45.0)
     self.assertTrue(hs.parse("u 2 2 8") == 55.0)
     self.assertTrue(hs.parse("u 1 8 9") == 80.0)
     self.assertTrue(hs.parse("u 2 8 9") == 20.0)