def test_SparseRegret(self): clique = S.cliques(self.ss)[0] clique_eq = N.mixed_nash(clique)[0] full_candidate = S.translate(clique_eq, clique, self.ss) self.assertEqual(R.regret(self.ss, full_candidate, deviation="A"), 0) self.assertEqual(R.regret(self.ss, full_candidate, deviation="B"), 0) self.assertEqual(R.regret(self.ss, full_candidate, deviation="C"), 1) self.assertEqual(R.regret(self.ss, full_candidate, deviation="D"), -1) self.assertEqual(R.regret(self.ss, full_candidate), 1)
def test_cliques(self): self.assertEqual(map(len, S.cliques(self.one_player)), [2]) self.assertEqual(map(len, S.cliques(self.one_strategy)), [1]) self.assertEqual(map(len, S.cliques(self.one_profile)), [1])
def test_cliques(self): self.assertEqual(map(len, S.cliques(self.cliques_full)), [9]) self.assertEqual(map(len, S.cliques(self.cliques_1)), [3,3,3]) self.assertEqual(map(len, S.cliques(self.cliques_2)), [3,3]) self.assertEqual(map(len, S.cliques(self.cliques_4)), []) self.assertEqual(map(len, S.cliques(self.ss)), [3])