Skip to content

Return result classes from solvers #1115

Description

@tturocy

The Nash algorithms have always returned simply a list of computed profiles. This standardisation ultimately dates back to algorithms being classes deriving from a base class, so a generic Solve signature was enforced.

A better and more modern design will be for each method to return a suitable Result object, which contains not just the computed equilibria (or other quantities) but, possibly, details on the operation of the algorithm and/or any error or warning conditions.

In particular the shape of the return value no longer needs to be a list. Some methods are only ever going to return a single profile, so returning a list is somewhat misleading; a std::optional would work (to allow for the possibility of an error return with a null profile. Likewise other methods may have more structured output (e.g. cliques for two-player games expressing convex sets of profiles).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions