Scenario

class negmas.inout.Scenario(agenda, ufuns, mechanism_type, mechanism_params)[source]

Bases: object

A class representing a negotiation domain

Attributes Summary

issue_names

rtype

list[str]

issues

rtype

tuple[Issue, ...]

n_issues

rtype

int

n_negotiators

rtype

int

Methods Summary

discretize([levels])

Discretize all issues

from_genius_files(domain, ufuns[, ...])

rtype

Scenario' | None

from_genius_folder(path[, ignore_discount, ...])

rtype

Scenario' | None

make_session([negotiators, n_steps, ...])

Generates a ready to run mechanism session for this domain.

normalize([rng])

Normalizes a utility function to the given range

remove_discounting()

Removes discounting from all ufuns

remove_reserved_values([r])

Removes reserved values from all ufuns replaacing it with r

scale_max([to])

Normalizes a utility function to the given range

scale_min([to])

Normalizes a utility function to the given range

to_genius_files(domain_path, ufun_paths)

Save domain and ufun files to the path as XML.

to_genius_folder(path)

Save domain and ufun files to the path as XML.

to_numeric()

Forces all issues in the domain to become numeric

to_single_issue([numeric, stringify])

Forces the domain to have a single issue with all possible outcomes

Attributes Documentation

issue_names
Return type

list[str]

issues
Return type

tuple[Issue, ...]

n_issues
Return type

int

n_negotiators
Return type

int

Methods Documentation

discretize(levels=10)[source]

Discretize all issues

static from_genius_files(domain, ufuns, ignore_discount=False, ignore_reserved=False, safe_parsing=True)[source]
Return type

Scenario’ | None

static from_genius_folder(path, ignore_discount=False, ignore_reserved=False, safe_parsing=True)[source]
Return type

Scenario’ | None

make_session(negotiators=None, n_steps=None, time_limit=None, roles=None, **kwargs)[source]

Generates a ready to run mechanism session for this domain.

normalize(rng=(0.0, 1.0))[source]

Normalizes a utility function to the given range

Parameters
  • ufun – The utility function to normalize

  • outcomes – A collection of outcomes to normalize for

  • rng (Tuple[float, float]) – range to normalize to. Default is [0, 1]

  • levels – Number of levels to use for discretizing continuous issues (if any)

  • max_cardinality – Maximum allowed number of outcomes resulting after all discretization is done

Return type

Scenario

remove_discounting()[source]

Removes discounting from all ufuns

remove_reserved_values(r=- inf)[source]

Removes reserved values from all ufuns replaacing it with r

scale_max(to=1.0)[source]

Normalizes a utility function to the given range

Parameters
  • ufun – The utility function to normalize

  • outcomes – A collection of outcomes to normalize for

  • rng – range to normalize to. Default is [0, 1]

  • levels – Number of levels to use for discretizing continuous issues (if any)

  • max_cardinality – Maximum allowed number of outcomes resulting after all discretization is done

Return type

Scenario

scale_min(to=1.0)[source]

Normalizes a utility function to the given range

Parameters
  • ufun – The utility function to normalize

  • outcomes – A collection of outcomes to normalize for

  • rng – range to normalize to. Default is [0, 1]

  • levels – Number of levels to use for discretizing continuous issues (if any)

  • max_cardinality – Maximum allowed number of outcomes resulting after all discretization is done

Return type

Scenario

to_genius_files(domain_path, ufun_paths)[source]

Save domain and ufun files to the path as XML.

to_genius_folder(path)[source]

Save domain and ufun files to the path as XML.

to_numeric()[source]

Forces all issues in the domain to become numeric

Remarks:
  • maps the agenda and ufuns to work correctly together

Return type

Scenario

to_single_issue(numeric=False, stringify=True)[source]

Forces the domain to have a single issue with all possible outcomes

Parameters
Remarks:
  • maps the agenda and ufuns to work correctly together

  • Only works if the outcome space is finite

Return type

Scenario