ComplexNonlinearUtilityFunction

class negmas.utilities.ComplexNonlinearUtilityFunction(ufuns: Iterable[negmas.utilities.UtilityFunction], combination_function=typing.Callable[[typing.Iterable[typing.Union[negmas.helpers.Distribution, float]]], typing.Union[negmas.helpers.Distribution, float]], name=None, reserved_value: Union[negmas.helpers.Distribution, float] = - inf, ami: Optional[negmas.common.AgentMechanismInterface] = None, outcome_type: Optional[Type] = None, id: Optional[str] = None)[source]

Bases: negmas.utilities.UtilityFunction

A utility function composed of nonlinear aggregation of other utility functions

Parameters
  • ufuns – An iterable of utility functions

  • combination_function – The function used to combine results of ufuns

  • name – Utility function name

Attributes Summary

ami

outcome_type

Methods Summary

eval(offer)

Calculate the utility_function value for a given outcome.

from_dict(d)

to_dict()

xml(issues)

Converts the function into a well formed XML string preferrably in GENIUS format.

Attributes Documentation

ami
outcome_type

Methods Documentation

eval(offer: Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]])Union[negmas.helpers.Distribution, float][source]

Calculate the utility_function value for a given outcome.

Parameters

offer – The offer to be evaluated.

Remarks:
  • You cannot return None from overriden apply() functions but raise an exception (ValueError) if it was not possible to calculate the UtilityValue.

  • Return A UtilityValue not a float for real-valued utilities for the benefit of inspection code.

Returns

The utility_function value which may be a distribution. If None it means the utility_function value cannot be calculated.

Return type

UtilityValue

classmethod from_dict(d: Dict[str, Any])[source]
to_dict()Dict[str, Any][source]
xml(issues: List[negmas.outcomes.Issue])str[source]

Converts the function into a well formed XML string preferrably in GENIUS format.

If the output has with </objective> then discount factor and reserved value should also be included If the output has </utility_space> it will not be appended in to_xml_str