Both the strategic and sequence form LCP implementations in src/nash/lcp carry around a Solution class (defined as a nested class inside the LCP algorithm driver) object, which includes working data on the current run of the algorithm. In refactoring LCP to use the new Nash equilibrium computation framework in Gambit 14, just enough was done to remove all algorithm state from the algorithm classes themselves. However, more could be done to encapsulate properly the algorithm state, including:
- Move some operations to be operations on the Solution class, rather than being done inline in the algorithm.
- Consider incorporating other working data, such as the Tableau classes. If possible, it might make sense to have the internal private member function calls passing around mostly just the game being solved, and the Solution class; possibly, the game itself should be part of that.
In addition, the filling of the Tableau in both implementations - but especially the sequence form version - is very awkwardly done. This could do with some proper encapsulation, rather than the current rather opaque indexing calculations.
Note that eventually something like the Solution class might be passed back to the caller (rather than just a list of computed equilibrium profiles), with the idea being that richer data on the running of the algorithm might be interesting. Design of this class should be done with that in mind.
Both the strategic and sequence form LCP implementations in src/nash/lcp carry around a Solution class (defined as a nested class inside the LCP algorithm driver) object, which includes working data on the current run of the algorithm. In refactoring LCP to use the new Nash equilibrium computation framework in Gambit 14, just enough was done to remove all algorithm state from the algorithm classes themselves. However, more could be done to encapsulate properly the algorithm state, including:
In addition, the filling of the Tableau in both implementations - but especially the sequence form version - is very awkwardly done. This could do with some proper encapsulation, rather than the current rather opaque indexing calculations.
Note that eventually something like the Solution class might be passed back to the caller (rather than just a list of computed equilibrium profiles), with the idea being that richer data on the running of the algorithm might be interesting. Design of this class should be done with that in mind.