gambitproject / gambit

Gambit: The package for computation in game theory
http://www.gambit-project.org
GNU General Public License v2.0
400 stars 150 forks source link

Create `to_array` for strategic-form instances of the Game class #461

Closed tturocy closed 1 month ago

tturocy commented 2 months ago

We already have pygambit.gambit.Game.from_arrays which creates a strategic-form Game from numpy arrays.

This issue is about creating essentially the inverse of this function that converts such a strategic-form Game into numpy arrays.

A natural test for this function would be to create a "roundtrip" that starts with a strategic-form Game, uses the new function, and then uses from_arrays on the output to go back to the original game.