negmas.outcomes Package
Defines basic concepts related to outcomes
Outcomes in this package are always assumed to be multi-issue outcomes where single-issue outcomes can be implemented as the special case with a single issue.
Both Continuous and discrete issues are supported. All issue will have names. If none is given, a random name will be used. It is HIGHLY recommended to always name your issues.
Outcomes are dictionaries with issue names as keys and issue values as values.
Examples
Different ways to create issues:
>>> issues = [make_issue((0.5, 2.0), 'price'), make_issue(['2018.10.'+ str(_) for _ in range(1, 4)], 'date')
... , make_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)
Outcome example compatible with the given set of issues:
>>> a = {'price': 1.2, 'date': '2018.10.04', 'count': 4}
Functions
|
Ensures that one and only one of the three inputs is given (i.e. not None). |
|
Ensures that at most one of the three inputs is given (i.e. not None). |
|
Returns an outcome space from either an outcome-space, a list of issues, a list of outcomes, or the number of outcomes |
|
Returns an outcome space from either an outcome-space, a list of issues, a list of outcomes, or the number of outcomes |
|
A factory for creating issues based on |
|
Generates a set of issues with given parameters. |
|
Imports a the domain issues from a GENIUS XML file. |
|
Imports a the domain issues from a GENIUS XML file. |
|
Exports a list/dict of issues from a GENIUS XML file. |
|
Exports a list/dict of issues from a GeniusWeb json file. |
|
Exports a the domain issues to a GENIUS XML file. |
|
Converts the list of issues into a well-formed xml string. |
|
Create a set of issues given some outcomes. |
|
Returns the total number of outcomes in a set of issues. |
|
Enumerates the outcomes of a list of issues. |
|
Enumerates all outcomes of this set of discrete issues if possible. |
|
Enumerates the outcomes of a list of issues. |
|
Samples some outcomes from the outcome space defined by the list of issues. |
|
Discretizes the issue space and returns either a predefined number of outcomes or uniform samples. |
|
Combines multiple issues into a single issue. |
|
Converts the outcome to a tuple no matter what was its type |
|
Converts the outcome to a dict no matter what was its type. |
|
Tests that the outcome is contained within the given range of outcomes. |
|
Tests that the outcome is valid and complete. |
|
Checks that the types of all issue values in the outcome are correct |
|
Test validity of an outcome given a set of issues. |
|
Calculates the difference between two outcomes given an outcome-space (optionally with issue weights). |
|
Minimum distance between an outcome and a set of outcomes in an outcome-spaceself. |
|
A factory to create outcome-spaces from lists of |
Classes
|
alias of |
|
alias of |
|
The base protocol for all outcome spaces. |
|
The base protocol for all outcome spaces with a finite number of items. |
|
An Outcome-Space that is constructed from a tuple of |
|
An Outcome-Space that is constructed from a tuple of |
|
Base class of all issues in NegMAS |
|
An |
|
An |
|
An |
|
An |
|
A |
|
An issue representing a range of values (can be continuous or discrete) |
|
An |
|
A |
|
A |
|
An issue that can have all integer values. |
|
An issue that can represent all real numbers |
Indicates that the issue is infinite (i.e. one or more of its limits is infinity). |
|
|
An outcome-space that is generated by the cartesian product of a tuple of |
|
A discrete outcome-space that is generated by the cartesian product of a tuple of |