Skip to content

Error in simulate_k with more than two teams #4

@kmcnayr

Description

@kmcnayr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions