@@ -38,6 +38,7 @@ def __init__(self, round_num: int, agents: list[Player]):
3838 # Map of player to game metric (e.g. # of wins, assets accumulated)
3939 self .scores : dict [str , float ] = {}
4040 self .player_stats : dict [str , PlayerStats ] = {agent .name : PlayerStats (name = agent .name ) for agent in agents }
41+ self .details : list [str ] = []
4142
4243 def __str__ (self ) -> str :
4344 rv = [f"In round { self .round_num } , the winner is { self .winner } ." , "\n Summary of player performance:" ]
@@ -46,6 +47,8 @@ def __str__(self) -> str:
4647 rv .append (f"- { player } : submission compiled successfully, score={ stats .score } " )
4748 else :
4849 rv .append (f"- { player } : submission failed with error: { stats .invalid_reason } " )
50+ if self .details :
51+ rv .extend (["Details:" ] + [f"- { line } " for line in self .details ])
4952 return "\n " .join (rv )
5053
5154 def to_dict (self ) -> dict [str , Any ]:
@@ -54,6 +57,7 @@ def to_dict(self) -> dict[str, Any]:
5457 return {
5558 "round_num" : self .round_num ,
5659 "winner" : self .winner ,
60+ "details" : self .details ,
5761 "scores" : {name : self .scores .get (name , 0.0 ) for name in player_names },
5862 "player_stats" : {name : stats .to_dict () for name , stats in self .player_stats .items ()},
5963 }
0 commit comments