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 an OptionalIssue 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 limits

    • Tuple[ -inf , int ] : This is a CountableInfiniteIssue that can take any integer value in the given limits

    • Tuple[ float , inf ] : This is a ContinuousInfiniteIssue that can take any real value in the given limits

    • Tuple[ -inf , float ] : This is a ContinuousInfiniteIssue that can take any real value in the given limits

    • CallableThe callable should take no parameters and should act as a generator of issue values. This

      type 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.