Skip to content

Commit

Permalink
Fix bug in Schelling diagram payoffs preventing some players from see…
Browse files Browse the repository at this point in the history
…ing round outcomes in reality show

PiperOrigin-RevId: 695925661
Change-Id: Id33580687b71e3adb467ea5426c874be65a70175
  • Loading branch information
jzleibo authored and copybara-github committed Nov 13, 2024
1 parent 33fa99c commit cee1819
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions concordia/components/game_master/schelling_diagram_payoffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def __init__(
self._partial_states = {player.name: '' for player in self._players}
self._player_scores = {player.name: 0 for player in self._players}

self._map_names_to_players = {
player.name: player for player in self._players}

self._resolution_scene = resolution_scene
self._current_scene = current_scene.CurrentScene(
name='current scene type',
Expand Down Expand Up @@ -265,6 +268,11 @@ def update_after_event(
# Use the outcome summarization function to get the state.
self._set_outcome_messages(rewards, binary_joint_action, joint_action)
self._memory.extend([self.state(),])
for player_name, partial_state in self._partial_states.items():
if partial_state:
if isinstance(self._map_names_to_players[player_name],
entity_agent.EntityAgent):
self._map_names_to_players[player_name].observe(partial_state)

joint_action_for_log = str(self._partial_joint_action)
payoffs_for_log = self.state()
Expand Down

0 comments on commit cee1819

Please sign in to comment.