Issues

class negmas.outcomes.Issues(**kwargs)[source]

Bases: object

Encodes a set of Issues.

Parameters

pairs (name-value) –

Remarks:

  • Issues can be initialized by either an iterable of strings, an integer or a tuple of two real values with the following meanings: - iterable of strings: This is an issue that can any value within the given set of values (strings) - int: This is an issue that takes any value from 0 to the given value -1 (int) - float: This is an issue that can take any real value between the given limits (min, max)

Attributes Summary

all

A generator that generates all possible values.

cardinality

The number of possible outcomes for the set of issues.

num_outcomes

Returns the total number of outcomes in a set of issues.

outcome_range

An outcome range that represents the full space of the issues

types

The type of the issue.

Methods Summary

from_issue_collection(issues)

from_single_issue(issue)

is_finite()

Test whether all issues are discrete (finite outcome space)

is_infinite()

Test whether any issue is continuous (infinite outcome space)

rand()

Picks a random valid value.

rand_invalid()

Pick a random invalid value

rand_valid()

Picks a random valid value.

Attributes Documentation

all

A generator that generates all possible values.

Remarks:
  • This function returns a generator for the case when the number of values is very large.

  • If you need a list then use something like:

cardinality

The number of possible outcomes for the set of issues.

num_outcomes

Returns the total number of outcomes in a set of issues. Infinity is returned for uncountable or continuous outcomes

outcome_range

An outcome range that represents the full space of the issues

types

The type of the issue.

Returns

either ‘continuous’ or ‘discrete’

Return type

str

Methods Documentation

classmethod from_issue_collection(issues: Iterable[negmas.outcomes.Issue])[source]
classmethod from_single_issue(issue: negmas.outcomes.Issue)[source]
is_finite()bool[source]

Test whether all issues are discrete (finite outcome space)

Returns

discrete or not

Return type

bool

is_infinite()bool[source]

Test whether any issue is continuous (infinite outcome space)

Returns

continuous or not

Return type

bool

rand()Dict[str, Union[int, float, str]][source]

Picks a random valid value.

rand_invalid()Dict[str, Union[int, float, str]][source]

Pick a random invalid value

rand_valid()Dict[str, Union[int, float, str]]

Picks a random valid value.