Skip to content

[Enh]: Refactor PHCpack interface #675

@tturocy

Description

@tturocy

The file src/pygambit/nashphc.py provides the layer that interfaces pygambit with PHCpack (currently used in the strategic form only).

This is a lightly-repackaged version of a free-standing script that used to be in contrib. As such it's, well, still a script - not a well-structured module.

This should be refactored to work more like a standard pipeline. In particular;

  • The generation of the PHCpack input file should be its own function - i.e. one that takes a support profile and returns the corresponding PHCpack input file, alongside a mapping between strategies in the game and their corresponding variable names in the PHCpack equation system.
  • Likewise, the parsing of the PHCpack output should be its own function. It should take the output text and the mapping from variables to strategies, and parse out and return the corresponding mixed strategy profiles. This should probably be done in two stages - a generic extract solution information function that parses the output into a JSON-like structure, and then the layer which converts that to Gambit objects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions