Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces parameter-based handling of external variables in player models, enabling each player to properly handle variables from other players through an internal parameter system. The evaluation of NonlinearExpr is now performed through recursive replacement.
- Adds parameter dictionary to Player struct for mapping external variables to internal parameters
- Implements recursive expression replacement for all JuMP expression types including NonlinearExpr
- Introduces Assignment abstraction for variable-value mappings with proper internalization
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Game/Player.jl | Adds parameter system to Player struct with recursive expression internalization |
| src/Game/Assignment.jl | New file implementing Assignment abstraction and recursive expression replacement |
| src/Game/Payoff.jl | Refactors payoff computation to use Assignment system instead of variable dictionaries |
| src/Game/BestResponse.jl | Updates best response computation to use new Assignment-based approach |
| src/SGM/PolymatrixGame/Polymatrix.jl | Refactors polymatrix computation to use Assignment system |
| src/SGM/Initialization.jl | Updates initialization to use player-specific variable references |
| src/SGM/DeviationReaction.jl | Minor refactoring for cleaner best response computation |
| test/tests.jl | Extensive test coverage for new parameter system and Assignment functionality |
…filter external references
dc4df9a to
bda2479
Compare
Owner
Author
|
rebased with fixed tests action |
the only significant change is adding an error when the replaced expression has no owner model nor isa Number. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
significant change: initializing payoff as 0, instead of NaN Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each player now handles external variables through parameters.
Evaluation of NonlinearExpr is performed through recursive replacement.