outcome_is_complete

negmas.outcomes.outcome_is_complete(outcome: Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]], issues: Collection[negmas.outcomes.Issue])bool[source]

Tests that the outcome is valid and complete.

Examples

>>> issues = [Issue((0.5, 2.0), 'price'), Issue(['2018.10.'+ str(_) for _ in range(1, 4)], 'date')                , Issue(20, 'count')]
>>> for _ in issues: print(_)
price: (0.5, 2.0)
date: ['2018.10.1', '2018.10.2', '2018.10.3']
count: (0, 19)
>>> print([outcome_is_complete({'price':3.0}, issues), outcome_is_complete({'date': '2018.10.4'}, issues)            , outcome_is_complete({'count': 21}, issues)])
[False, False, False]
>>> valid_incomplete = {'price': 1.9}
>>> print(outcome_is_complete(valid_incomplete, issues))
False
>>> valid_incomplete.update({'date': '2018.10.2', 'count': 5})
>>> print(outcome_is_complete(valid_incomplete, issues))
True
>>> invalid = {'price': 2000, 'date': '2018.10.2', 'count': 5}
>>> print(outcome_is_complete(invalid, issues))
False
>>> invalid = {'unknown': 2000, 'date': '2018.10.2', 'count': 5}
>>> print(outcome_is_complete(invalid, issues))
False
Args:

outcome: outcome tested which much contain valid values all issues if it is to be considered complete. issues: issues

Returns

If return_problem is True then a second return value contains a string with

reason of failure

Return type

Union[bool, Tuple[bool, str]]