Source:
Local role: Abstract utility interface required by the model layer.
Big-picture role: Domain-neutral contract defining how actor-relative perceived states are scored under an interpretive framework.
Inheritance:
- abstract base class
Core contract:
framework_idpropertyis_multi_criteriapropertyevaluate(perception, actor, context) -> UtilityFrame
Helper behavior:
- deterministic missing-metric resolution policies
- standardized UtilityFrame construction helpers
Concrete game-layer implementations:
Example:
from ometeotl_core.model.utility import UtilityFunction, UtilityFrame
class ResourceScoreUtility(UtilityFunction):
"""Score an actor by the number of resources they hold."""
@property
def framework_id(self):
return "resource_score"
@property
def is_multi_criteria(self):
return False
def evaluate(self, perception, actor, context):
count = len(perception.memberships_for_object(actor.id))
return UtilityFrame(value=float(count), framework_id=self.framework_id)
