User

class negmas.elicitation.User(ufun: Optional[negmas.utilities.UtilityFunction] = None, cost: float = 0.0, ami=None)[source]

Bases: object

Abstract base class for all representations of users used for elicitation

Parameters
  • ufun – The real utility function of the user.

  • cost – A cost to be added for every question asked to the user.

  • ami – [Optional] The AgentMechanismInterface representing the negotiation session engaged in by this user using this ufun.

Attributes Summary

ufun

Gets a UtilityFunction representing the real utility_function of the user

Methods Summary

ask(q)

Query the user and get a response.

cost_of_asking([q, answer_id, …])

Returns the cost of asking the given Quers.

elicited_queries()

Returns a list of elicited queries.

is_satisfied(constraint[, outcomes])

Checks if the given consgtraint is satisfied for the user utility fun and the given outocmes.

set([ufun, cost])

Sets the ufun and/or cost for this user <0:desc>

Attributes Documentation

ufun

Gets a UtilityFunction representing the real utility_function of the user

Methods Documentation

ask(q: Optional[negmas.elicitation.Query])negmas.elicitation.QResponse[source]

Query the user and get a response.

cost_of_asking(q: Optional[negmas.elicitation.Query] = None, answer_id: int = - 1, estimate_answer_cost=True)float[source]

Returns the cost of asking the given Quers.

Parameters
  • q – The query

  • answer_id – If >= 0, the answer expected. Used to add the specific cost of the answer if estimate_answer_cost is True

  • estimate_answer_cost – If True and answer_id >= 0, the specific cost of getting this answer is added.

elicited_queries()List[negmas.elicitation.ElicitationRecord][source]

Returns a list of elicited queries.

For each elicited query, the following dataclass is returned: ElicitationRecord(query, cost, answer_index, step)

is_satisfied(constraint: negmas.elicitation.Constraint, outcomes=typing.List[typing.Union[negmas.outcomes.OutcomeType, typing.Tuple[typing.Union[int, float, str, list]], typing.Dict[typing.Union[int, str], typing.Union[int, float, str, list]]]])bool[source]

Checks if the given consgtraint is satisfied for the user utility fun and the given outocmes.

Parameters
  • constraint – The Constraint

  • outcome – A list of `Outcome`s to be passed to the constraint along with the user’s ufun.

set(ufun: Optional[negmas.utilities.UtilityFunction] = None, cost: Optional[float] = None)[source]

Sets the ufun and/or cost for this user <0:desc>

Parameters
  • ufun – The ufun if given

  • cost – The cost if given