Skip to content

v0.16.0

Choose a tag to compare

@yasserfarouk yasserfarouk released this 01 Sep 07:22
· 31 commits to main since this release

Install with pip install negmas==0.16.0.

Changes

  • [situated] World._step_negotiations no longer loops forever on a negotiation
    that ends before it starts. A mechanism left with fewer than two negotiators and
    no dynamic_entry gives up without ever starting, and the world decided whether
    to keep stepping it with not state.ended -- but ended implies started
    by design, so it read False forever and the mechanism was stepped indefinitely. A
    finite negotiation_speed masked this by capping the passes per world step;
    with negotiation_speed=None the loop never terminated and only the world's
    wall-clock time_limit broke it out. The same predicate was wrong in two more
    places (the running-negotiation filters in _step_negotiations' bookkeeping).

    ended keeps its meaning exactly -- it still implies started, so downstream
    code reading it as "ran, then concluded" is unaffected. The stepping decision now
    uses a new property, MechanismState.ended_or_never_started, which is ended
    widened to the two ways a negotiation stops without starting: it was abandoned for
    lack of negotiators (the new ended_without_starting flag) or a step/time limit
    was already exceeded at the first step (timedout). Use it, not ended, to
    decide whether a mechanism still needs stepping; Mechanism exposes it too.

  • [deps] Require setuptools>=83.0.0. Versions below that are affected by
    CVE-2026-59890, in which a Unicode normalization collision (NFC/NFD) on macOS
    APFS/HFS+ lets a file bypass its MANIFEST.in exclusion and be included in
    an sdist. setuptools is a declared runtime dependency, so the bound is
    raised here rather than left to the environment.

  • [helpers] Parallel runs no longer share one random stream. Every worker
    process re-imports negmas and re-applies NEGMAS_RAND_SEED for itself, so
    a seeded tournament had all of its workers starting from the same stream:
    two tasks drawing the same sequence returned the same result, and repetitions
    of one configuration collapsed onto a single outcome instead of sampling the
    variation they exist to measure. Each dispatched task is now seeded from its
    own index (negmas.helpers.rand.task_seed, derived with numpy's
    SeedSequence), so tasks are independent, a run reproduces whatever the
    scheduling order or worker count, and a serial run reproduces a parallel one.
    Unseeded runs are dispatched exactly as before -- the task is not wrapped at
    all when no seed is in effect. Libraries that dispatch their own parallel
    work rather than going through negmas.helpers.parallel can get the same
    behaviour from the public task_seed(index) and apply_seed(seed).

  • [helpers] Every random number generator NegMAS uses can now be seeded from a
    single switch, so a whole run can be reproduced. Set NEGMAS_RAND_SEED (or
    the rand_seed config key) to an integer before a run and both the global
    random and numpy.random generators are seeded with it as
    negmas is imported; leaving it unset keeps the previous behaviour of
    drawing fresh entropy every run, and NEGMAS_RAND_SEED=random asks for that
    explicitly. The same can be done in-process with
    negmas.helpers.rand.seed_all(42), and libraries built on NegMAS can attach
    their own generators to the switch with register_seeder() -- a seeder
    registered after a seed is already in effect is called immediately with it, so
    import order does not matter. Seeding is best-effort: a generator that cannot
    be seeded warns rather than raising, and the unset default does not add
    anything to import negmas.

  • [cli] New negmas seed command printing every environment setting that
    makes a run reproducible -- NEGMAS_RAND_SEED plus the seeding knobs of
    the common libraries used alongside NegMAS, including PYTHONHASHSEED,
    which cannot be set from inside a running process. Apply them to a shell
    with eval "$(negmas seed 44)", or use --no-export to get bare
    NAME=VALUE lines for a .env file.

  • [inv_ufun] The presorting inverters' nearest-utility search is vectorized.
    _nearest_around opened by overwriting the search radius its caller passed,
    so every call walked the entire utility array in a Python loop. worst_in
    and best_in call it on each concession step, which made it the single
    largest cost of a negotiation on a large domain: 13ms a call, and 2.204s of
    the 3.450s a 100-step Boulware-vs-Boulware negotiation took on the ANAC-2026
    Travel domain (188,160 outcomes) -- 64% of the runtime, paid by every
    negotiator that concedes toward a utility target. The scan still considers
    every entry, because the array is not sorted end to end and so cannot be
    bisected; what changes is that the per-entry work is numpy's rather than the
    interpreter's. Results are unchanged, ties included, and n is now
    documented as accepted and ignored rather than silently discarded.

  • [preferences] Scenarios can optionally carry their ufuns' inverses on disk,
    so repeated negotiations over the same scenario skip re-inverting. Save with
    dumpas(..., save_inverse=True) and load with
    Scenario.load(..., load_cached_inverse=True); both halves are opt-in and
    default to off. Saving without save_inverse deletes any cache in the
    folder, while update() preserves it. A cache is only reused when the
    outcome space, reserved value and inverter configuration all match and
    re-evaluating the ufun reproduces the stored utilities; anything else rebuilds.
    Modifying a ufun disables its cache (call mark_modified() for in-place
    mutation). Non-stationary and constrained ufuns are never cached. Arrays are
    stored as .npz read with allow_pickle=False. Inverters consult the
    cache in their own init(), so every negotiator benefits.
    Remarks:

    • invert() now keys its cache on the inverter kwargs as well as the type,
      so a call with a different configuration no longer silently returns an
      inverter built with another one.
    • Genius XML does not preserve issue types, so a cache saved alongside XML is
      usually rejected on reload and rebuilt.
  • [outcomes] Integer range issues now support an optional step (defaulting
    to 1) giving the stride between consecutive values, so an issue taking
    the even values between 0 and 10 (inclusive) can be created with either
    make_issue((0, 10), step=2) or make_issue((0, 10, 2)). A three-valued
    tuple is read as (min, max, step) -- but only when the third value is not
    larger than max - min (otherwise a ValueError is raised, as before).
    When the range is not a whole multiple of the step, the maximum is clamped
    down to the last attainable value ((0, 10, 3) yields 0, 3, 6, 9 with
    max_value == 9), which keeps all, cardinality, value_at,
    contains and all sampling/generation methods consistent and makes the
    representation idempotent. Issue.step is available on every issue type
    (1 unless a stride was requested), Issue.__eq__ now takes it into
    account, and Issue.intersect preserves it when the two grids align.
    Remarks:

    • A step is only supported for integer ranges; passing one for a continuous
      or infinite range (or a list of values) raises ValueError.
    • Genius XML cannot express a stride, so a stepped issue is written as an
      enumerated discrete issue (values are preserved; as for any discrete
      issue they are read back as strings). YAML/Scenario round-trips
      preserve the issue exactly.
    • Behavior is unchanged in every respect when no step is given.
  • [tournaments] Added negmas.tournaments.analysis, a new post-tournament
    game-theoretic and statistical analysis package (AI-assisted; see the
    README's "AI Assistance Disclosure"):

    • Loaders (load_records/records_from_simple_results/records_from_path/
      records_from_situated) convert a tournament result -- in memory
      (SimpleTournamentResults from cartesian_tournament, or a situated
      TournamentResults), on disk, or an already-normalized DataFrame --
      into one common long-format record table. The situated adapter only
      decomposes worlds whose number of competitor agent types (excluding
      non_competitors, per the tournament's n_competitors_per_world) is
      exactly 2; other worlds are skipped with a warning since a pairwise
      payoff matrix is not well defined for them.
    • payoff.build_payoff_table/iterated_elimination build the empirical
      pairwise payoff matrix (with a same-strategy self-play diagonal
      precondition) that every method below consumes.
    • equilibria: pure symmetric Nash equilibria and the "EGTA based
      evaluation" method, deviation regret, Nash-averaging/NE-regret ranking,
      and optional mixed-strategy Nash equilibria via nashpy (new
      negmas[egta] extra).
    • ranking: Sequential Elimination Ranking and Tournament Evaluation --
      both from de Jonge's "Introduction to Automated Negotiation", chapter 6.
    • dynamics: symmetric and asymmetric (two-population) replicator
      dynamics.
    • significance: pairwise statistical-significance testing (paired and
      unpaired t-test, rank-sum, Kolmogorov-Smirnov) with Bonferroni/Holm/
      Benjamini-Hochberg corrections, and per-strategy normality diagnostics
      (skewness/kurtosis, Shapiro-Wilk, D'Agostino K²).
    • plotting/significance: optional matplotlib/networkx plots for
      every method above (payoff heatmap, deviation graph, replicator-dynamics
      trajectories, ranking bar charts, significance heatmap/marks).
    • report.analyze_tournament: one-call orchestration running every
      method above and optionally saving results (and plots) to disk; usable
      fully post-hoc on any in-memory or on-disk tournament result, or
      automatically via cartesian_tournament(..., run_analysis=True, analysis_plots=True), which saves everything under <path>/analysis.
  • [tournaments] Added two opt-in features to cartesian_tournament
    (and pass-through support in continue_cartesian_tournament):

    • A thread-pool executor (executor="thread", default remains
      executor="process") alongside the existing process-pool path, for
      I/O-bound negotiators (e.g. those making LLM API calls), avoiding
      per-task (de)serialization and process-spawn overhead. Thread mode
      provides no per-negotiation timeout enforcement
      : Python threads
      cannot be force-killed, so external_timeout is not enforced and a
      hung negotiation will not be terminated -- negotiators run this way
      must implement their own client-side I/O timeout. process_isolation= True combined with executor="thread" raises ValueError.
      Backed by a new run_threaded_tasks/resolve_workers in
      negmas.helpers.parallel.
    • Error-aware resume: retry_failed_on_resume/retry_timedout_on_resume
      (both default False) let path_exists="continue" re-run
      previously-failed or previously-timed-out negotiations instead of
      permanently treating any existing result file as done. Neither flag
      (nor executor) is persisted into the saved tournament config, to
      avoid perturbing the stable per-negotiation run_id used for resume
      file-naming across all existing tournament directories.
  • [preferences] Fixed LinearAdditiveUtilityFunction.normalize/
    normalize_for ignoring constraints: the analytic per-issue
    canonicalization assumed each issue's value-function range is independent,
    so it normalized against the unconstrained outcome range even when
    constraints removed the extreme outcomes (e.g. a constraint 0 < x < 2
    left the constrained min mapping to 0.4 instead of 0). When the
    ufun has constraints, normalize_for now falls back to the generic
    minmax-based scaling inherited from BaseUtilityFunction, which
    respects constraints via extreme_outcomes/minmax.

  • [inout] Scenario.calc_extra_stats now reports Kalai, Kalai-Smorodinsky,
    and max-welfare solution concepts alongside Nash — both the global
    (kalai_utils/kalai_outcome, ks_utils/ks_outcome,
    max_welfare_utils/max_welfare_outcome) and the bilateral
    (bilateral_kalai_*/bilateral_ks_*/bilateral_max_welfare_*)
    variants, mirroring the existing Nash reporting and honoring the
    convex_hull switch. Also fixed a pre-existing copy-paste bug where the
    stats-present branch assigned nash_outcomes to nash_utils.

  • [preferences] Added a convex_hull: bool evaluation-model switch to
    every user-facing optimality/distance/plotting entry point so a
    computation runs entirely under the P∞ (multiple-negotiations /
    convex-hull) model or entirely under the ordinary single-negotiation
    P model — never a mix. The switch is on calc_scenario_stats,
    ScenarioStats (carried on the stats object so
    calc_outcome_distances/calc_outcome_optimality honor it without a
    separate parameter), Scenario.calc_stats/calc_extra_stats/
    plot/save_plots, the Mechanism solution methods
    (pareto_frontier, nash_points, kalai_points,
    modified_kalai_points, max_welfare_points,
    max_relative_welfare_points) and to_completed_run, and the
    plotters (plot_2dutils/plot_offline_run/plot_mechanism_run).
    Completed the convex-hull bargaining family: new
    max_relative_welfare_points_convex_hull and a subtract_reserved_value
    parameter on kalai_point_convex_hull/ks_point_convex_hull for the
    modified variants. Under P∞, the Nash/Kalai/KS solutions are mixtures
    (a utility point realized by a lottery over hull vertices, not any single
    outcome), so ScenarioStats stores the utility point with empty
    *_outcomes; the Pareto distance uses the continuous convex-hull
    frontier (dist_to_convex_hull_frontier, 2-negotiator; discrete
    fallback otherwise). Covered by tests in tests/core/test_preferences.py
    and the smoke script coding_agents/test_convex_hull_switch.py.

  • [preferences] Fixed pareto_frontier_convex_hull (the P∞
    multiple-negotiations Pareto frontier of Mohammad 2023,
    https://ieeexplore.ieee.org/document/10405386) raising
    scipy.spatial.QhullError on (near-)collinear or otherwise
    lower-dimensional input (e.g. any two-issue zero-sum scenario, where every
    point lies on one line) — previously documented as an accepted limitation,
    now handled by projecting degenerate point sets onto their affine span
    before computing the hull. This uncovered two deeper, pre-existing
    correctness bugs in the same function that made it effectively unusable
    even on non-degenerate input: an internal reduce() fold silently
    changed the type of its accumulator partway through (points became
    indices), raising ValueError on almost any input with 3 or more
    points; and the returned indices were an identity permutation of the
    input rather than the actual frontier, since the "filtered" result of the
    onion-peeling loop was never connected back to the indices being
    returned. The function is rewritten to correctly implement its documented
    semantics — mixture (lottery) domination verified via linear programming,
    not just point-wise comparison — and gains test coverage in
    tests/core/test_preferences.py.

  • [negotiators] Exposed the hardcoded constants used by every negotiator as
    constructor hyperparameters, so hyperparameter search can tune them without
    hand-building components. Covers first-party components
    (HybridOfferingPolicy, FastMiCROOfferingPolicy,
    NiceTitForTatOfferingPolicy, KindConcessionRecommender, the
    PolyAspiration/ExpAspiration curve exponents, ...), first-party
    negotiators (Hybrid, MiCRO, FastMiCRO, both tit-for-tats,
    CAB/CAN/CAR, WAB/WAR/WAN,
    LimitedOutcomesNegotiator, SimpleNegotiator), and 211 of the 217
    constants in the transcompiled Genius/ANAC ports
    (gb.components.genius), which now also accept
    offering_params/acceptance_params/model_params. Also fixed two
    latent bugs found while wiring this up: HybridOfferingPolicy's four
    Bezier parameters were silently overwritten on every
    on_preferences_changed (NaN is now the documented "auto" sentinel,
    so user-supplied values survive), and several CAB/WAR/Nice negotiators
    discarded a caller-supplied offering component via
    kwargs["offering"] = X() instead of setdefault.

  • [preferences] New value functions: TrapezoidalFun, GaussianFun,
    AggregatingFun (weighted sum of value funs, with optional 0-1
    normalization), BiasedFun (adds a bias to value funs like
    IdentityFun/LinearFun that don't have one), and
    MultiModalTrapezoidalFun/MultiModalGaussianFun (tuple-parameterized
    mixtures built on AggregatingFun). docs/value_functions.rst is now a
    full gallery with a generated figure for every single- and multi-issue value
    fun type.

  • [situated] Fixed World breaking negotiations mid-flight when
    negotiation_speed was finite. _step_negotiations budgeted the
    per-simulation-step negotiation allowance by counting passes over the
    mechanisms instead of negotiation rounds. A pass is not a round: sync
    controllers answer with WAIT until they have collected offers from all
    their parallel negotiations (a WAIT does not advance state.step), and
    mechanisms stepped one offer at a time (atomic_steps) take two passes per
    round. So even negotiation_speed > neg_n_steps could exhaust the budget
    before a negotiation finished; the unfinished negotiation was then killed and
    broke spuriously with (REJECT, None). The budget is now counted in rounds
    actually advanced during the step (halved for atomic_steps mechanisms), so
    negotiation_speed >= neg_n_steps always runs every negotiation to
    completion within the step, matching negotiation_speed=None.

  • [situated] Added world-level and per-agent annotations on the World/Agent
    side, mirroring the mechanism-side annotations exposed through the NMI.
    World(annotation=...) stores a common metadata dict accessible to every agent
    through awi.annotation (and recorded in world.params["annotation"]), the
    direct analogue of Mechanism(annotation=...) -> nmi.annotation.
    World.join(agent, annotation=...) accepts a per-agent annotation that is merged
    with the world annotation (per-agent keys override world keys for that agent only),
    mirroring Mechanism.add(negotiator, annotation=...). Agent(private_info=...)
    adds a fully-private channel exposed via agent.annotation / agent.private_info
    that is never shared with the world or other agents, mirroring
    Negotiator(private_info=...). Note the same naming split as on the negotiator
    side: awi.annotation is the shared/per-agent-merged dict, while
    agent.annotation is the fully-private one.

  • [gb] Fixed MAPNegotiator silently dropping its
    private_info["opponent_ufun"] registration. The first UFunModel among
    the negotiator's models is registered under the opponent_ufun discovery
    key (backing the Negotiator.opponent_ufun property), but it was written to a
    local dict before super().__init__ re-initialised _private_info from
    the private_info kwarg, wiping the registration whenever no explicit
    private_info was passed. The dict is now routed through kwargs so the base
    class and the registration share the same object.

  • [models] Recovered additional opponent models from Baarslag et al. (2016),
    Learning about the opponent in automated bilateral negotiation (JAAMAS
    30:849-898), filling gaps in the survey's Table-2 taxonomy. New preference
    profile (UFunModel) estimators in negmas.gb.components.models (mirrored
    in negmas.sao.components.models): ConcessionRatioUFunModel (Niemann &
    Lang) and ValueDifferenceUFunModel (Carbonneau & Vahidov) and
    KDEWeightUFunModel (Coehoorn & Jennings) for issue-weight learning
    (§5.3.1); LuceProfileClassifierModel (Lin et al.) for Bayesian
    profile classification (§5.3.2); and CandidateEliminationModel for the
    ordinal acceptable-offer heuristic (§5.3.4).

  • [models] New framework-agnostic opponent-attribute models in negmas.models:
    ReservationValueModel family (ConcessionExtrapolatingReservationModel,
    BayesianReservationValueModel after Zeng & Sycara) for reservation-value
    estimation (§5.1.1); and offering-strategy forecasters
    PolynomialOfferingModel (Papaioannou et al.), DerivativeOfferingModel
    (Brzostowski et al.) and MarkovChainOfferingModel (Narayanan & Jennings)
    added to negmas.models.strategy (§5.4).

  • [registry] Registered the new preference-profile models under the existing
    model component type and added three new component types —
    reservation-model, deadline-model and offering-model — covering the
    non-ufun opponent-attribute models.

  • [genius] Refactored the transcompiled Genius BOA components from single modules
    (genius/models.py, genius/acceptance.py, genius/offering.py) into
    packages with one concern per file. All public names are re-exported as
    before; no import changes needed.

  • [inv_ufun] Refactored inv_ufun.py into a package (inv_ufun/) with one
    class per file. All public names are re-exported from
    negmas.preferences.inv_ufun as before; no import changes needed.

  • [inv_ufun] New BIDSInverseUtilityFunction: implements the BIDS
    (Bidding using Diversified Search) algorithm from Koça et al. (2024).
    Builds a dynamic-programming table in init() (O(|I|·|V|·10^p)) that
    allows one_in() queries in O(1) and some() in O(n_samples).
    Scales to outcome spaces with 10^200+ outcomes. Only works with
    LinearAdditiveUtilityFunction / LinearUtilityFunction
    ; raises
    TypeError for other ufun types.

  • [inv_ufun] New AdaptiveInverseUtilityFunction: automatically selects
    the best concrete inverter based on ufun type and outcome-space size.
    Delegates to PresortingInverseUtilityFunction for spaces with
    ≤ max_presorting_outcomes outcomes (default 10^6, exact), and to
    BIDSInverseUtilityFunction for larger additive spaces (approximate but
    scalable). Recommended entry-point for code that should work across a wide
    range of domain sizes.

  • [inv_ufun] Renamed PresortingInverseUtilityFunction (waypoint-based,
    legacy) → PresortingLegacyInverseUtilityFunction and the previously
    un-waypointed sibling PresortingInverseUtilityFunction2 →
    PresortingInverseUtilityFunction (new default). Empirical benchmarks show
    the waypoint coarse-search is ~2× slower than a direct numpy searchsorted
    at every tested scale (100 – 10^6 outcomes), so the simpler variant is now
    canonical. PresortingLegacyInverseUtilityFunction is kept for backward
    compatibility.

  • [pareto_sampler] New pareto_sampler sub-package introducing the
    ParetoSampler protocol for trade-off queries (finding Pareto-optimal
    outcomes given an estimate of the opponent's utility function) and
    IPSParetoSampler, an implementation of the IPS (Iterative Pareto Search)
    algorithm from Koça et al. (2024). The opponent utility function is accessed
    via Negotiator.opponent_ufun (None when no estimate is available).

  • [gb] New NiceTitForTatNegotiator (with its components
    NiceTitForTatOfferingPolicy, the ACCombi acceptance condition, and the
    opponent models FrequencyLinearUFunModel / FrequencyUFunModel /
    PeekingOpponentModel): a negmas port of Baarslag, Hindriks & Jonker's
    Nice Tit for Tat agent that reproduces the Genius reference behaviour —
    reciprocal concession measured in the agent's own utility, a Nash-aiming
    target with a discount/time concession bonus, an opponent-attractive ("nice")
    bid selected via a ParetoSampler, and the reference makeAppropriate
    guard. target selects the bargaining solution to aim for
    (nash/kalai/kalai_smorodinsky/max_welfare/max_relative_welfare).
    Re-exported from negmas.sao.negotiators.

  • [gb] Fix GPerfectModel (the Genius PerfectModel oracle) was a
    non-functional placeholder — its update() was a stub, the opponent ufun
    was never stored and eval/eval_normalized always returned 0.5.
    It is now a working oracle: it accepts the opponent's true ufun via
    ufun= and delegates eval/eval_normalized to it, sharing the
    single code path of PeekingOpponentModel (de-duplicated). Any Genius
    opponent model — e.g. GScalableBayesianModel (the port of Nice Tit for
    Tat's own BayesianOpponentModelScalable) — can also be passed to
    NiceTitForTatNegotiator via opponent_model_type=.

  • [pareto_sampler] API change: ParetoSampler implementations now take
    configuration only in their constructors; the operands (own and opponent
    ufuns) are supplied to init(ufun=..., opponent_ufun=...) — where the
    expensive frontier build happens. A single instance can therefore be
    re-init-ed with new operands instead of recreated, and
    BaseUtilityFunction.make_pareto_sampler now reuses one cached instance,
    re-initialising it when the opponent estimate changes. New
    BruteForceParetoSampler (exact, works with any ufun) uses the vectorised
    pareto_frontier_numpy (~200× faster than the O(n²) pareto_frontier_bf).

  • [pareto_sampler] New AdaptiveParetoSampler (exported also as
    DefaultParetoSampler) and it is now the default used by
    BaseUtilityFunction.make_pareto_sampler (and by the Nice Tit for Tat
    offering policy). It dispatches on the outcome-space size — determined in
    init from the supplied ufun — using the exact BruteForceParetoSampler
    for small spaces (cardinality <= max_bruteforce_outcomes, default 10_000)
    and a scalable backend (MOBANOSParetoSampler by default, or
    IPSParetoSampler for very large additive domains) otherwise, falling back
    to brute force when the large backend cannot handle the ufuns.

  • [inv_ufun] New closest(target, normalized=False) query on the
    InverseUFun protocol and all inverters: returns the single outcome whose
    utility is closest to a target (argmin_ω |u(ω) - target| — the
    utility-lookup query of Koça et al. 2024, distinct from the range-based
    one_in). Exact for the enumerating/sorted inverters (BruteForce,
    Presorting, PresortingLegacy) and BIDS; approximate (by design) for the
    sampling / MCTS / attribute-planning inverters.

  • [models] New opponent-attribute model types filling the two families from
    Baarslag et al. (2016) Table 2 that were missing from negmas.models: a
    deadline family (DeadlineModel / ConcessionExtrapolatingDeadlineModel,
    §5.2) and an offering-strategy family (OpponentOfferingModel /
    TimeSeriesOfferingModel, §5.4). All four attribute families are now
    exported from negmas.models.

  • [gb/registry] The new NiceTitForTatNegotiator and its components
    (NiceTitForTatOfferingPolicy, ACCombi, PeekingOpponentModel) are
    registered in the built-in registry, and a set of previously-unregistered
    built-in negotiators/policies were added too (time-based following /
    offer-oriented negotiators, the comparator/ranker/sorter elicitation
    negotiators, and the CAB/WAR/MiCRO/FastMiCRO/Hybrid/TFT
    offering and TFT/MiCRO/AcceptFinalOffer/ACLastFractionReceived
    acceptance policies).

  • [common] Renamed the two ambiguous NegotiatorInfo classes so the name is
    unambiguous: negmas.common.NegotiatorInfo (the name/id/type
    descriptor returned by Mechanism.participants) → NegotiatorDescriptor,
    and negmas.negotiators.common.NegotiatorInfo (the
    (negotiator, context) pairing used by Controller) → NegotiatorEntry
    (now a typed NamedTuple). NegotiatorInfo at the top level now
    unambiguously refers to the registry's NegotiatorInfo.

  • [preferences] pareto_frontier: n_discretization now applies only to
    continuous issues (fully-finite outcome spaces are always enumerated exactly),
    and outcomes whose utility is non-finite for any ufun are skipped so
    opponent-model stand-ins can be passed safely. Documented the relative speed
    of the individual pareto_frontier_* extractors — and flagged the actually
    broken pareto_frontier_numpy_faster (raises IndexError) and the
    effectively-hanging pareto_frontier_of — in the module and method
    docstrings. (A later pass corrected pareto_frontier_convex_hull's
    docstring, which had wrongly been flagged as broken too: it deliberately
    computes the multiple-negotiations Pareto frontier P∞ of Mohammad
    (2023, "Evaluating Automated Negotiations",
    https://ieeexplore.ieee.org/document/10405386) — the convex-hull
    restriction is by design, not a bug, though it still raises QhullError on
    (near-)collinear inputs.)

  • [inv_ufun] Added comprehensive performance benchmark
    (coding_agents/benchmark_all_inverters.py) comparing all inverters across
    outcome spaces from 25 to 10^200. Results are documented in the
    negmas.preferences.inv_ufun module docstring.

  • [inv_ufun] Documented a strict-vs-clamping taxonomy across all inverters in
    their class docstrings, and reclassified SamplingInverseUtilityFunction
    from strict to clamping (its worst_in/best_in now fall back to a
    boundary outcome when the requested utility range is too narrow to sample,
    rather than returning None). Strict inverters (BruteForce,
    PresortingInverseUtilityFunctionBruteForce) return None for
    out-of-range queries; all others clamp to the nearest in-range outcome.

Bug Fixes:

  • [sao] sao.components.models.ufun duplicated the UFunModel,
    ZeroSumModel, FrequencyUFunModel and FrequencyLinearUFunModel
    implementations from negmas.gb.components.models.ufun instead of
    re-exporting them like its sibling modules (weights.py,
    classifier.py, heuristic.py) already did, leaving the
    Frequency* duplicates as NotImplementedError stubs. It now
    re-exports the gb implementations, so negmas.FrequencyUFunModel /
    negmas.FrequencyLinearUFunModel (both resolved through sao) are
    fully functional.

  • [gb] NiceTitForTatOfferingPolicy read the opponent model via
    getattr(self.negotiator, "opponent_model", None) — a property only
    NiceTitForTatNegotiator itself defines — instead of the standard
    Negotiator.opponent_ufun property that every UFunModel component
    populates automatically. Simplified to direct attribute access (no
    getattr needed; opponent_ufun is always defined and was already
    guaranteed non-None at that point).

  • [preferences] BIDSInverseUtilityFunction, MCTSInverseUtilityFunction
    and AttributePlanningInverseUtilityFunction all built their per-issue
    value lists via list(issue.all), which raises ValueError for any
    continuous issue (it is uncountable) — crashing init() for any additive
    ufun with a real-valued issue, including through
    AdaptiveInverseUtilityFunction whenever a continuous outcome space's
    infinite cardinality routed it to BIDS. Added a shared _issue_values()
    helper that discretizes any non-discrete issue into continuous_levels
    grid points via Issue.to_discrete().

  • [preferences] A BaseFun nested inside another BaseFun's field (e.g.
    in AggregatingFun/BiasedFun) was silently corrupted on save whenever
    the outer value fun was itself held by LinearAdditiveUtilityFunction /
    GLAUtilityFunction / GPAUtilityFunction /
    NonLinearAggregationUtilityFunction / PAUtilityFunction, since the
    generic serializer bypassed the nested fun's own to_dict(). Those five
    ufun classes now serialize each value fun via its own to_dict(). (A
    follow-up commit also corrected a couple of TrapezoidalFun docstring
    doctest values left stale by its boundary-condition handling.)

  • [helpers] Distribution.Real.prob used the (always-false) chained
    comparison self == val < EPSILON instead of comparing val to the
    point mass's location, so it never reported a nonzero probability except by
    accident. Fixed to abs(val - self._loc) < EPSILON. Also added missing
    __radd__/__rsub__/__rmul__/__and__/__rand__ operators
    and canonicalized distribution-family-name handling (UNIFORM/NORMAL
    constants and a canonical_distribution_type() helper accepting aliases
    like "norm"/"gaussian"/"unif") so naming is consistent across
    negmas.helpers.prob.

  • [preferences] BaseUtilityFunction.__call__ no longer raises
    AttributeError for ufun-like objects (e.g. @define opponent models)
    that skip BaseUtilityFunction.__init__ and therefore lack
    _invalid_value / _constraints; such objects can now be used anywhere a
    ufun is accepted (pareto_frontier, the bargaining-solution calculators, a
    ParetoSampler).

  • [inv_ufun] SamplingInverseUtilityFunction was non-instantiable
    (TypeError: Can't instantiate abstract class due to missing implementations
    of best, max, min, within_fractions, within_indices,
    worst). Added all required methods, delegating to the wrapped ufun's own
    minmax()/extreme_outcomes().

  • [inv_ufun] SamplingInverseUtilityFunction.best_in had a sign inversion
    (compared util < best_util instead of >), causing it to return the
    worst outcome in a range rather than the best.

  • [inv_ufun] PresortingInverseUtilityFunction.one_in called
    _indx_of_worst_in twice instead of pairing it with _indx_of_best_in,
    so it always returned the same non-random outcome rather than sampling
    uniformly across the qualifying range.

  • [inv_ufun] PresortingInverseUtilityFunction.one_in early-returned None
    before the documented fallback_to_higher / fallback_to_best logic could
    trigger, silently discarding valid fallback outcomes.

  • [inv_ufun] index_below_or_equal / _nearest_around could return outcomes
    outside the requested utility range, causing best_in/worst_in to return
    out-of-range results. Replaced with textbook-correct bisection helpers in
    _common.py.

  • [inv_ufun] PresortingInverseUtilityFunctionBruteForce.reset() referenced
    self._orddered_outcomes (typo) instead of self._ordered_outcomes,
    silently failing to clear state between init() calls.

  • [inv_ufun] PresortingInverseUtilityFunctionBruteForce.some() fallback used
    a normalization-unaware comparison, producing incorrect results when the ufun
    range exceeded [0, 1].

  • [gb] UtilBasedNegotiator now recovers from a None proposal (when the
    inverter finds no outcome in the requested aspiration range — e.g. a strict
    inverter queried out of range, or a clamping inverter whose fallbacks are
    exhausted) by falling back to the best outcome. Previously it returned
    None, which the SAO mechanism treats as a refusal to propose, setting
    state.broken = True and ending the negotiation with no agreement.

  • [inv_ufun] All clamping inverters (BIDS, MCTS,
    AttributePlanning, and SamplingInverseUtilityFunction\ 's
    worst_in/best_in) now apply the same fallback pattern as one_in
    (expand the utility range upward, then return the nearest boundary outcome)
    so they never return None on a non-empty outcome space. Previously a
    too-narrow aspiration range (e.g. boulware asking for
    [0.99999997, 1.0]) could make them return None and break the
    negotiation.

  • [sao] Exposed the full trace API on SAONMI: full_trace,
    full_trace_with_utils, full_trace_with_utils_df, and
    negotiator_full_trace now delegate to the underlying mechanism so the
    NMI mirrors SAOMechanism\ 's complete trace API.

  • [preferences] HyperRectangleUtilityFunction normalization
    (normalize/normalize_for/minmax) now maps the affine range to
    [0, 1] with exact extrema computed via a max-weight clique over the
    rectangle-overlap graph (Helly's theorem for axis-aligned boxes) — no
    enumeration of the (up to 10^50) outcome space. Also serializes bias and
    fixes an oucome_ranges → outcome_ranges typo in from_dict.

  • [inout] Scenario.remove_dummy_issues() drops single-value placeholder
    issues (e.g. the lenient Genius reader's DUMMY_ISSUE), folding their
    constant contribution into the ufun bias so utilities are preserved.
    Genius loading of all-numeric ufuns now keeps the per-issue value functions
    instead of folding slope/bias into the weights (which produced negative
    weights that broke the canonical form on reload). Also removed an
    unhashable @lru_cache from ConstFun.minmax.

  • [outcomes] New negmas.outcomes.discretizers framework: a Discretizer
    protocol plus grid-based and utility-aware balanced discretizers
    (variance/quantile and outcome-count-in-bins, over one or many ufuns, with
    optional full_grid coordinate-descent / differential_evolution
    optimization). New SubsetCartesianOutcomeSpace enumerates/validates an
    explicit outcome subset while keeping .issues.
    OutcomeSpace.to_discrete gains a method= argument accepting a
    Discretizer name/class/instance.

  • [preferences] Reconciled normalization around a single funnel:
    normalize/normalize_for are thin wrappers over one
    normalize_all_for shared by every ufun type;
    AffineUtilityFunction maps the reserved value through the full affine
    map; normalizing an affine ufun to [0, 1] returns the Method-3 canonical
    LinearAdditive form (weights sum to 1) that round-trips to Genius XML;
    and constant/zero-weight affine ufuns now normalize to a
    ConstUtilityFunction instead of raising.

  • [outcomes] Made outcome_space truthiness safe:
    DiscreteCartesianOutcomeSpace.__len__ overflows Py_ssize_t on large
    spaces (a product of issue cardinalities), so any if outcome_space test
    raised OverflowError — replaced with explicit is None checks across
    the codebase and added __bool__ (cardinality > 0) as
    defense-in-depth. Also restored generator/iterator support in
    os_or_none\ 's outcomes branch.

  • [registry] Registered the Python-native Genius BOA negotiators
    (GBoulware, GConceder, GLinear, GHardliner,
    GHardHeaded, GAgentK, GAgentSmith, GNozomi, GFSEGA,
    GCUHKAgent, GAgentLG, GAgentX, GRandom) unconditionally,
    since they run natively without the Java Genius bridge.

Release 0.15.8

Changes

  • [cartesian] cartesian_tournament gained two parameters that give callers
    control over process isolation and how unserializable tasks are handled
    (both threaded through the saved config so continued tournaments keep the
    setting):

    • process_isolation: None (auto, the previous behavior), True
      (always isolate each task in its own process), or False (run in-process,
      skipping the per-task serialization/spawn cost; warns if a finite timeout is
      set since it cannot be hard-enforced in-process).
    • allow_inline_fallback: when False, a task whose payload cannot be
      cloudpickled is failed via on_error with UnserializableTaskError
      (recorded as a failed run with the reserved value for every negotiator)
      instead of silently running unprotected in-process and losing the
      external_timeout hard-kill guarantee.

    run_isolated_tasks now always surfaces an in-process fallback, printing the
    offending negotiator class names and the exact serialization error to stderr
    and via warnings (defeating Python's once-per-site dedup) rather than
    swallowing the exception.

Bug Fixes:

  • [fix] SAOMechanism.full_trace now records the negotiator(s) that
    accepted an offer in the responses dict instead of the proposer. An
    off-by-one in get_acceptances started counting acceptances at the
    proposer's own index, so an accepted offer (e.g. an immediate agreement) was
    mislabeled with the proposer's id rather than the acceptor's. The range now
    starts one past the proposer, wrapping correctly for >2 negotiators. The
    offerer's implicit acceptance is excluded when offering_is_accepting is
    True; when it is False the offerer's explicit acceptance is recorded.