mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-19 12:58:09 +00:00
bug fixes
This commit is contained in:
parent
754cf8e23b
commit
2338e3c6e6
6 changed files with 170 additions and 32 deletions
|
|
@ -23,6 +23,7 @@ Version: 2.0 (Hard Mode with complete validation)
|
|||
import os
|
||||
import json
|
||||
import csv
|
||||
import sys
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
from collections import defaultdict, Counter
|
||||
|
|
@ -42,6 +43,8 @@ except ImportError:
|
|||
"models.PowerEnum not found via absolute or relative import. "
|
||||
) from exc
|
||||
|
||||
csv.field_size_limit(sys.maxsize)
|
||||
|
||||
class StatisticalGameAnalyzer:
|
||||
"""Production-ready analyzer for AI Diplomacy game statistics.
|
||||
|
||||
|
|
@ -363,6 +366,8 @@ class StatisticalGameAnalyzer:
|
|||
|
||||
# Categorize by relationship
|
||||
recipient = msg.get('recipient_power')
|
||||
if recipient is None:
|
||||
continue
|
||||
try:
|
||||
normalized_recipient = PowerEnum(recipient).value
|
||||
except ValueError:
|
||||
|
|
@ -696,6 +701,8 @@ class StatisticalGameAnalyzer:
|
|||
|
||||
# Categorize by relationship
|
||||
recipient = msg.get('recipient_power')
|
||||
if recipient is None:
|
||||
continue
|
||||
# This will coerce some known aliases to match the 7 acceptable names (see models.py)
|
||||
normalized_recipient = PowerEnum(recipient)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue