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 playerstrategies: 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— returnsactor_idandstrategy_ids
Important behavior:
- raises
ValueErrorifstrategiesis 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:
