Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### Changed
- `lcp_solve` no longer silently absorbs internal exceptions if they occur, but instead these propagate out
to match the behaviour of all other Nash equilibrium solvers. (#996)
- `gnm_solve` executes callback when equilibrium is found rather than emitting all equilibria at the end of
the run. (#998)
- Implemented bespoke XML parser that handles the subset in the de-facto legacy XML workbook .gbt format;
removes dependency on tinyxml. (#897)

Expand Down
3 changes: 1 addition & 2 deletions src/solvers/gnm/gnm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ Solve(const Game &p_game, const std::shared_ptr<gnmgame> &p_rep, const cvector &
};
GNM(*p_rep, norm_pert, answers, p_steps, FUZZ, p_localNewtonInterval, p_localNewtonMaxits,
p_lambdaEnd, WOBBLE, THRESHOLD, callback, return_message);
for (auto answer : answers) {
for (const auto &answer : answers) {
eqa.push_back(ToProfile(p_game, answer));
p_callback(eqa.back(), "NE");
}
return eqa;
}
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/gtracer/gnm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void GNM(gnmgame &A, cvector &g, std::list<cvector> &Eq, int steps, double fuzz,
if (ee < fuzz) { // only save high quality equilibria;
// this restriction could be removed.
Eq.push_back(sigma);
// PrintProfile(std::cout, "NE", sigma);
p_onStep("NE", Eq.back());
}
Index = -Index;
s_hat_old = -1;
Expand Down
3 changes: 2 additions & 1 deletion src/solvers/gtracer/gtracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ namespace Gambit::gametracer {
/// @param threshold the equilibrium error threshold for doing a wobble. If
/// wobbles are disabled, GNM will terminate if the error
/// reaches this threshold.
/// @param p_onStep a callback function executed on each step of the algorithm
/// @param p_onStep a callback function executed on each step of the algorithm and whenever an
/// equilibrium is found (with label "NE")
void GNM(gnmgame &A, cvector &g, std::list<cvector> &Eq, int steps, double fuzz, int LNMFreq,
int LNMMax, double LambdaMin, bool wobble, double threshold,
std::function<void(const std::string &, const cvector &)> p_onStep,
Expand Down
Loading