PlayerProfile

Source:

Local role: Binds one actor to their available strategies and utility function for a single game instance.

Big-picture role: An actor in the world is not inherently a player — it becomes one when it holds a declared set of choices and a way to value outcomes. PlayerProfile is that declaration: it gives an actor a strategic identity by making explicit what it can do and what it is trying to achieve.

Inheritance:

  • standard dataclass

Constructor:

  • PlayerProfile(actor, strategies, utility_function)

Fields:

  • actor: Actor — the actor participating as a player
  • strategies: list[Strategy] — the set of admissible strategies for this player (at least one required)
  • utility_function: UtilityFunction — the interpretive framework used to score this player’s outcomes

Methods:

  • to_dict() -> JsonMap — returns actor_id and strategy_ids

Important behavior:

  • raises ValueError if strategies is empty

Example:

from ometeotl_core.game.game_state import GameState, PlayerProfile
from ometeotl_core.game.utility import WeightedSumUtility

utility = WeightedSumUtility("resource_efficiency", {"resources": 1.0})
profile = PlayerProfile(
    actor=actor,
    strategies=[strategy_a, strategy_b],
    utility_function=utility,
)

game_state = GameState(
    id="game-1",
    world_id="world-1",
    players=[profile],
)

See also:

Ometeotl

A Python library to build complex multi-agent simulations, wargames, and AI-driven strategies