How to use the nashpy.algorithms.support_enumeration.obey_support function in nashpy

To help you get started, we’ve selected a few nashpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
def test_obey_support_with_high_tolerance(self):
        """Test for obey support"""
        A = np.array([[2, 1], [0, 2]])
        B = np.array([[2, 0], [1, 2]])
        tol = 1
        self.assertFalse(obey_support(False, np.array([0, 1])))
        self.assertFalse(
            obey_support(np.array([1, 0]), np.array([0, 1]), tol=tol)
        )
        self.assertFalse(obey_support(np.array([1, 0]), np.array([0]), tol=tol))
        self.assertFalse(
            obey_support(np.array([0, 0.5]), np.array([1]), tol=tol)
        )
        self.assertFalse(
            obey_support(np.array([0.5, 0]), np.array([0]), tol=tol)
        )
        self.assertFalse(
            obey_support(np.array([0.5, 0.5]), np.array([0, 1]), tol=tol)
        )
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
def test_obey_support(self):
        """Test for obey support"""
        A = np.array([[2, 1], [0, 2]])
        B = np.array([[2, 0], [1, 2]])
        self.assertFalse(obey_support(False, np.array([0, 1])))
        self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
        self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
        self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))

        self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
        self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
def test_obey_support_with_high_tolerance(self):
        """Test for obey support"""
        A = np.array([[2, 1], [0, 2]])
        B = np.array([[2, 0], [1, 2]])
        tol = 1
        self.assertFalse(obey_support(False, np.array([0, 1])))
        self.assertFalse(
            obey_support(np.array([1, 0]), np.array([0, 1]), tol=tol)
        )
        self.assertFalse(obey_support(np.array([1, 0]), np.array([0]), tol=tol))
        self.assertFalse(
            obey_support(np.array([0, 0.5]), np.array([1]), tol=tol)
        )
        self.assertFalse(
            obey_support(np.array([0.5, 0]), np.array([0]), tol=tol)
        )
        self.assertFalse(
            obey_support(np.array([0.5, 0.5]), np.array([0, 1]), tol=tol)
        )
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
def test_obey_support(self):
        """Test for obey support"""
        A = np.array([[2, 1], [0, 2]])
        B = np.array([[2, 0], [1, 2]])
        self.assertFalse(obey_support(False, np.array([0, 1])))
        self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
        self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
        self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))

        self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
        self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
def test_obey_support(self):
        """Test for obey support"""
        A = np.array([[2, 1], [0, 2]])
        B = np.array([[2, 0], [1, 2]])
        self.assertFalse(obey_support(False, np.array([0, 1])))
        self.assertFalse(obey_support(np.array([1, 0]), np.array([0, 1])))
        self.assertFalse(obey_support(np.array([0, 0.5]), np.array([0])))
        self.assertFalse(obey_support(np.array([0.5, 0]), np.array([1])))

        self.assertTrue(obey_support(np.array([1, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0, 0.5]), np.array([1])))
        self.assertTrue(obey_support(np.array([0.5, 0]), np.array([0])))
        self.assertTrue(obey_support(np.array([0.5, 0.5]), np.array([0, 1])))