Skip to content

Parameters#1

Merged
brunompacheco merged 27 commits intomainfrom
parameters
Aug 11, 2025
Merged

Parameters#1
brunompacheco merged 27 commits intomainfrom
parameters

Conversation

@brunompacheco
Copy link
Owner

Each player now handles external variables through parameters.

Evaluation of NonlinearExpr is performed through recursive replacement.

@brunompacheco brunompacheco requested a review from Copilot August 11, 2025 23:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@brunompacheco
Copy link
Owner Author

brunompacheco commented Aug 11, 2025

rebased with fixed tests action

brunompacheco and others added 2 commits August 11, 2025 19:35
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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@brunompacheco brunompacheco merged commit fc11e08 into main Aug 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants