mirror of
https://github.com/GoodStartLabs/AI_Diplomacy.git
synced 2026-04-19 12:58:09 +00:00
Bit of a cleanup
Moved all the files that don't need to be at top level to the experiments folder. Started using uv to init the project, should the install easier.
This commit is contained in:
parent
5b85b9f89e
commit
a93a89f7cb
26 changed files with 1608 additions and 5097 deletions
41
experiments/test_analyzer.py
Executable file
41
experiments/test_analyzer.py
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Quick test of the game analyzer on a specific phase
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from analyze_game_moments import GameAnalyzer
|
||||
|
||||
async def test_single_phase():
|
||||
"""Test analysis on a single phase to verify everything works"""
|
||||
|
||||
# Path to test game
|
||||
game_path = "/Users/alxdfy/Documents/mldev/AI_Diplomacy/results/20250515_005239_francewin_25pro/lmvsgame.json"
|
||||
|
||||
# Initialize analyzer
|
||||
analyzer = GameAnalyzer(game_path)
|
||||
await analyzer.initialize()
|
||||
|
||||
# Get a specific phase to test (Spring 1901)
|
||||
test_phase = analyzer.game_data["phases"][0] # First phase
|
||||
|
||||
print(f"Testing on phase: {test_phase.get('name', 'Unknown')}")
|
||||
print(f"Number of messages: {len(test_phase.get('messages', []))}")
|
||||
print(f"Number of powers with orders: {len(test_phase.get('orders', {}))}")
|
||||
|
||||
# Run analysis
|
||||
moments = await analyzer.analyze_turn(test_phase)
|
||||
|
||||
print(f"\nFound {len(moments)} moments")
|
||||
for moment in moments:
|
||||
print(f"- {moment.category}: {', '.join(moment.powers_involved)} (Score: {moment.interest_score})")
|
||||
print(f" Promise: {moment.promise_agreement[:100]}...")
|
||||
print(f" Reality: {moment.actual_action[:100]}...")
|
||||
print()
|
||||
|
||||
return moments
|
||||
|
||||
if __name__ == "__main__":
|
||||
moments = asyncio.run(test_single_phase())
|
||||
print("Test complete!")
|
||||
Loading…
Add table
Add a link
Reference in a new issue