Scenario
- class negmas.inout.Scenario(agenda, ufuns, mechanism_type, mechanism_params)[source]
Bases:
object
A class representing a negotiation domain
Attributes Summary
- rtype
- rtype
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
Removes discounting from all ufuns
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.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
Methods Documentation
- 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
- 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
- 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
- to_numeric()[source]
Forces all issues in the domain to become numeric
- Remarks:
maps the agenda and ufuns to work correctly together
- Return type
- to_single_issue(numeric=False, stringify=True)[source]
Forces the domain to have a single issue with all possible outcomes
- Parameters
numeric – If given, the output issue will be a
ContiguousIssue
otherwise it will be aDiscreteCategoricalIssue
stringify – If given, the output issue will have string values. Checked only if
Numeric and Mathematical Modules
isFalse
- Remarks:
maps the agenda and ufuns to work correctly together
Only works if the outcome space is finite
- Return type