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

Error in simulate_k with more than two teams #4

Open
kmcnayr opened this issue Oct 29, 2023 · 1 comment
Open

Error in simulate_k with more than two teams #4

kmcnayr opened this issue Oct 29, 2023 · 1 comment

Comments

@kmcnayr
Copy link

kmcnayr commented Oct 29, 2023

I am trying to run a k simulations with more than two teams and am receiving this error:

ValueError: Shape of passed values is (30, 2), indices imply (30, 3)

I tracked it down to this line in _battle.simulate_k

runs = np.zeros((k, 2), dtype=np.int64)

it is assuming the results have only two teams. I think a quick fix is to change to the below which is the number of teams:

runs = np.zeros((k, np.unique(self._teams).shape[0]), dtype=np.int64)

the team_counts results returned by simulate_battle contain a records for each unique team in M.

This appears to work for up to 30+ teams/allegiances

@kmcnayr kmcnayr changed the title Error in simulate_k when more than two teams Error in simulate_k with more than two teams Oct 29, 2023
@gregparkes
Copy link
Owner

Thank you for this issue.

Changes have been made as you suggested:

runs = np.zeros((k, np.unique(self._teams).shape[0]), dtype=np.int64)

Please pull the latest, and re-build your version using the Anaconda instructions, or via pip3 install . within a suitable environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants