make_issue
- negmas.outcomes.make_issue(values, *args, optional=False, **kwargs)[source]
A factory for creating issues based on
values
type as well as the base class of all issues- Parameters:
values – Possible values for the issue
name – Name of the issue. If not given, a random name will be generated
optional (
bool
) – If given anOptionalIssue
will be created
Remarks:
Issues can be initialized by either an iterable of strings, an integer or a tuple of two values with the following meanings:
list of anything
: This is an issue that can any value within the given set of values (strings, ints, floats, etc). Depending on the types in the list, a different issue type will be created:integers -> CardinalIssue
a type that supports subtraction -> OrdinalIssue (with defined order and defined difference between values)
otherwise -> CategoricalIssue (without defined order or difference between values)
int
: This is a ContiguousIssue that takes any value from 0 to the given value -1 (int)Tuple[
int
,int
] : This is a ContiguousIssue that can take any integer value in the given limits (min, max)Tuple[
float
,float
] : This is a ContinuousIssue that can take any real value in the given limits (min, max)Tuple[
int
,inf
] : This is a CountableInfiniteIssue that can take any integer value in the given limitsTuple[
-inf
,int
] : This is a CountableInfiniteIssue that can take any integer value in the given limitsTuple[
float
,inf
] : This is a ContinuousInfiniteIssue that can take any real value in the given limitsTuple[
-inf
,float
] : This is a ContinuousInfiniteIssue that can take any real value in the given limitsCallable
The callable should take no parameters and should act as a generator of issue values. Thistype of issue is always assumed to be neither countable nor continuous and are called uncountable. For example, you can use this type to make an issue that generates all integers from 0 to infinity. Most operations are not supported on this issue type.
If a list is given, min, max must be callable on it.