Beispiel #1
0
    def utility(self, role):
        """The utility of the current state for the given role."""
        with Frame():
            utility = Term()
            utility_query = self._goal_functor(
                Term.from_atom(role._atom), utility)
            self._query_term(utility_query)(check=True)

            if utility.is_atom():
                return int(utility.get_atom_name())
            else:
                return int(utility)