How to use the nashpy.algorithms.support_enumeration.is_ne 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
strategy_pair = np.array([1, 0]), np.array([0, 1])
        support_pair = [0], [1]
        self.assertFalse(is_ne(strategy_pair, support_pair, (A, B)))

        A = np.array([[1, -1], [-1, 1]])
        strategy_pair = np.array([1 / 2, 1 / 2]), np.array([1 / 2, 1 / 2])
        support_pair = [0, 1], [0, 1]
        self.assertTrue(is_ne(strategy_pair, support_pair, (A, -A)))

        A = np.array([[0, 1, -1], [-1, 0, 1], [1, -1, 0]])
        strategy_pair = (
            np.array([1 / 3, 1 / 3, 1 / 3]),
            np.array([1 / 3, 1 / 3, 1 / 3]),
        )
        support_pair = [0, 1, 2], [0, 1, 2]
        self.assertTrue(is_ne(strategy_pair, support_pair, (A, -A)))

        strategy_pair = (np.array([1, 0, 0]), np.array([1, 0, 0]))
        support_pair = [0], [0]
        self.assertFalse(is_ne(strategy_pair, support_pair, (A, -A)))

        A = np.array(
            [[160, 205, 44], [175, 180, 45], [201, 204, 50], [120, 207, 49]]
        )
        B = np.array([[2, 2, 2], [1, 0, 0], [3, 4, 1], [4, 1, 2]])
        self.assertTrue(
            is_ne(
                (
                    np.array((0, 0, 3 / 4, 1 / 4)),
                    np.array((1 / 28, 27 / 28, 0)),
                ),
                (np.array([2, 3]), np.array([0, 1])),
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
A = np.array([[1, -1], [-1, 1]])
        strategy_pair = np.array([1 / 2, 1 / 2]), np.array([1 / 2, 1 / 2])
        support_pair = [0, 1], [0, 1]
        self.assertTrue(is_ne(strategy_pair, support_pair, (A, -A)))

        A = np.array([[0, 1, -1], [-1, 0, 1], [1, -1, 0]])
        strategy_pair = (
            np.array([1 / 3, 1 / 3, 1 / 3]),
            np.array([1 / 3, 1 / 3, 1 / 3]),
        )
        support_pair = [0, 1, 2], [0, 1, 2]
        self.assertTrue(is_ne(strategy_pair, support_pair, (A, -A)))

        strategy_pair = (np.array([1, 0, 0]), np.array([1, 0, 0]))
        support_pair = [0], [0]
        self.assertFalse(is_ne(strategy_pair, support_pair, (A, -A)))

        A = np.array(
            [[160, 205, 44], [175, 180, 45], [201, 204, 50], [120, 207, 49]]
        )
        B = np.array([[2, 2, 2], [1, 0, 0], [3, 4, 1], [4, 1, 2]])
        self.assertTrue(
            is_ne(
                (
                    np.array((0, 0, 3 / 4, 1 / 4)),
                    np.array((1 / 28, 27 / 28, 0)),
                ),
                (np.array([2, 3]), np.array([0, 1])),
                (A, B),
            )
github drvinceknight / Nashpy / tests / unit / test_support_enumeration.py View on Github external
np.array([1 / 3, 1 / 3, 1 / 3]),
            np.array([1 / 3, 1 / 3, 1 / 3]),
        )
        support_pair = [0, 1, 2], [0, 1, 2]
        self.assertTrue(is_ne(strategy_pair, support_pair, (A, -A)))

        strategy_pair = (np.array([1, 0, 0]), np.array([1, 0, 0]))
        support_pair = [0], [0]
        self.assertFalse(is_ne(strategy_pair, support_pair, (A, -A)))

        A = np.array(
            [[160, 205, 44], [175, 180, 45], [201, 204, 50], [120, 207, 49]]
        )
        B = np.array([[2, 2, 2], [1, 0, 0], [3, 4, 1], [4, 1, 2]])
        self.assertTrue(
            is_ne(
                (
                    np.array((0, 0, 3 / 4, 1 / 4)),
                    np.array((1 / 28, 27 / 28, 0)),
                ),
                (np.array([2, 3]), np.array([0, 1])),
                (A, B),
            )