Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update heuristic_payoff_table.py: replace np.math.factorial with math… #1244

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions open_spiel/python/egt/heuristic_payoff_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import abc
import collections
import math

import numpy as np

Expand Down Expand Up @@ -261,15 +262,18 @@ class _PayoffTableInterface(metaclass=abc.ABCMeta):
def __call__(self):
"""Returns a view of the table as a np.array."""

@abc.abstractproperty
@property
@abc.abstractmethod
def num_strategies(self):
pass

@abc.abstractproperty
@property
@abc.abstractmethod
def num_players(self):
pass

@abc.abstractproperty
@property
@abc.abstractmethod
def num_rows(self):
pass

Expand Down Expand Up @@ -501,7 +505,7 @@ def _multinomial_coefficients(distributions):
Args:
distributions: The distributions table [num_rows, num_strategies].
"""
v_factorial = np.vectorize(np.math.factorial)
v_factorial = np.vectorize(math.factorial)
# Multinomial coefficients (one per distribution Ni).
# ( P )
# ( Ni1, Ni1, ... Nik )
Expand Down
Loading