Repository navigation
New:
- [outcomes]
ListIssueandRecordIssue. One issue holds a
variable-length list of elements, ordered or unordered, withmin_count,
max_countandunique_by. The issue supports sampling,mutate,
to_discreteand serialization. - [outcomes]
IntIssueandRealIssue(factories over the infinite
issues), and the newStrIssue. - [preferences]
RecordAdditiveFun,ListAggregationFun,
ListAggregationMultiFunandlift_element_ufunscore lists. Extremes
are found greedily and exactly; an unbounded sum raises
UnboundedListUtilityError. - [preferences]
SearchInverseUtilityFunction. Inverters and Pareto
samplers search list, string and infinite-integer issues instead of
enumerating them, so the time-based negotiators work on them. - [helpers] Per-component seeding. Every Pareto sampler,
SamplingInverseUtilityFunctionandNiceTitForTatNegotiator
(sampler_seed) take aseed;with seeded(s):does the same for any
block of code. Both run on a privateRandomStreamand leave the global
generators untouched. The default (None) changes nothing. - [preferences, outcomes]
seed=on every random ufun generator (all
.random()classmethods,UtilityFunction.generate_random,
generate_bilateralandgenerate_random_bilateral, the functions in
preferences.generators,IPUtilityFunction.sample, distributions'
sample) and on outcome-space sampling (sample,random_outcome,
enumerate_or_sample). The same seed gives the same result; the default
(None) draws from the global generators as before. Built on the new
seedabledecorator. - [helpers] Ids of named objects, mechanisms, contracts, breaches and
negotiation requests are reproducible once a global seed is set
(negmas.helpers.rand.uuid4), from a stream that never shifts other draws.
Changes:
- [outcomes]
DiscreteOutcomeSpaceandDiscreteCartesianOutcomeSpace
are renamedEnumerableOutcomeSpaceand
EnumerableCartesianOutcomeSpace: they hold finite, listable spaces,
whileis_discrete()now allows infinite ones. The old names still work
but warn (NegmasDeprecationWarning). Saving writes the new name, so
files saved by this version need it to load; files with the old name
still load, with a warning. Projects should requirenegmas>=0.17
before switching to the new names or saving files with them. - [outcomes]
is_discrete()now means countable (possibly infinite),
is_finite()means finitely many values, and the newis_enumerable()
means all values can be listed; issues and outcome spaces implement all
three. Code that enumerates checksis_enumerable(). A
CountableInfiniteIssue(and aStrIssue) is discrete but neither
finite nor enumerable: it is sampled, never enumerated. - [outcomes] Infinite issues sample from a configurable
typicalrange:
before, sampling was uniform over±sys.maxsize, or returned
inf/nanfor reals. Copying an infinite issue keeps its type. - [preferences] Normalizing a value function that is unbounded over its issue
raises a clearValueError. - [gb]
WARNegotiatorraises a clear error on infinite outcome spaces. - [mechanisms]
Mechanism.addstill returnsNonewhen it refuses a
negotiator, but now also emitsNegmasNegotiatorRefusedWarningnaming the
reason.
Fixes:
- [deps] Lock patched versions of certifi, pillow, nbconvert, virtualenv,
setuptools, tornado and filelock (security advisories). - [preferences]
LinearAdditiveUtilityFunction.normalize_for(to=...)and
normalize(to=...)returned [0, 1] whatevertowas. Normalizing over a
non-Cartesian outcome space crashed; it now uses the generic path. - [mechanisms] Seeded runs did not repeat: every mechanism step drew a random
number once per wall-clock second even withpend_per_second=0, so what
every later draw saw depended on timing. The draw is now made only when
pend_per_secondis positive. - [situated] An accepted negotiation request stored the
uuidmodule itself
as its id instead of the request's id. - [preferences]
ExpDiscountedUFun.randomandLinDiscountedUFun.random
crashed when given a list of issues (the documented input). They take
issues or an outcome space now, whatever the base ufun type expects. - [preferences]
WeightedUtilityFunction.randomand
ComplexNonlinearUtilityFunction.randomstored the reserved-value range
itself as the reserved value instead of sampling from it, and passed
normalizedto their components as the reserved value. - [preferences]
LambdaFun/LambdaMultiFun.minmaxclipped the maximum to
max_valueinstead of widening it. - [preferences] Pareto samplers:
pareto_outcomes()dropped every outcome
with negative utility (its defaultmin_utilwas 0); it now keeps the
whole front.IPSParetoSamplerclamped negative partial utilities to 0 and
returned dominated outcomes. - [outcomes] Scenarios whose domain holds a
ListIssueorRecordIssue
failed to load (No module named 'negmas.negmas'): short type names
resolve asnegmas.<Name>, and the new classes were not exported there.
SingletonIssue,SingletonOutcomeSpace,UFunConstraintand
UtilityFunctionAdapterhad the same problem. - [typing] Annotations in
genius/negotiator.py,situated/world.pyand
scripts/negotiate_core.pynamedAgent,ActionandAnywithout
importing them, so type checkers andtyping.get_type_hintscould not
resolve them. - [docs] The
NiceTitForTatNegotiatordocstring no longer emits an
"Unexpected indentation" warning in the docs build, and its grouped
parameter descriptions now match the code.