Skip to content

Commit 2c0d467

Browse files
committed
docs: fix broken examples and update publications
- Fix API breaking changes in all documentation examples: * Replace SAOMetaNegotiator with SAOAggMetaNegotiator for aggregation * Update LinearAdditiveUtilityFunction.random() to use keyword arg * Fix GBNegotiator/BOANegotiator BOA components example - Update publications list with 2024-2025 papers (12 new entries) - Add caveat note for ensemble sub-negotiator behavior - Update AGENTS.md with documentation testing requirements - All examples verified working with test files in coding_agents/
1 parent cd2e8f4 commit 2c0d467

File tree

6 files changed

+84
-36
lines changed

6 files changed

+84
-36
lines changed

AGENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,37 @@
1919
3. **WAIT FOR EXPLICIT "PUSH" COMMAND**
2020
4. Only then run `git push`
2121

22+
## ⚠️ CRITICAL: DOCUMENTATION EXAMPLES MUST ALWAYS WORK ⚠️
23+
24+
**ALL EXAMPLES IN README.rst AND docs/ MUST BE TESTED AND WORKING AT ALL TIMES**
25+
26+
**BEFORE ANY COMMIT THAT CHANGES APIs OR EXAMPLES:**
27+
1. Test EVERY code example in `README.rst`
28+
2. Test EVERY code example in `docs/*.rst`
29+
3. All examples must run without errors
30+
4. Create/update test files in `coding_agents/` directory to verify examples
31+
32+
**TEST PROCEDURE:**
33+
```bash
34+
# Test README examples
35+
python coding_agents/test_readme_examples.py
36+
37+
# Test documentation examples
38+
python coding_agents/test_doc_examples.py
39+
```
40+
41+
**WHEN UPDATING APIs:**
42+
1. Search for ALL usages of the old API in README.rst and docs/
43+
2. Update ALL examples to use the new API
44+
3. Test ALL updated examples
45+
4. Never commit broken examples
46+
47+
**COMMON PATTERNS TO CHECK:**
48+
- `LinearAdditiveUtilityFunction.random()` - must use `issues=` or `outcome_space=` keyword arg
49+
- `SAOMetaNegotiator` with aggregation methods - should be `SAOAggMetaNegotiator`
50+
- Any deprecated or changed class names
51+
- Any deprecated or changed method signatures
52+
2253
## Build/Test Commands
2354
```bash
2455
pytest # Run all tests
@@ -45,6 +76,7 @@ pre-commit run --all-files # Run all pre-commit hooks
4576
- **Errors**: Raise `ValueError`/`TypeError` with descriptive messages; use `negmas.warnings` for deprecations
4677
- **Source location**: Main code in `src/negmas/`, tests in `tests/`
4778
- **Docstrings**: ALWAYS test every docstring example you add using `python -c "..."` or `pytest --doctest-modules` before committing
79+
- **Documentation examples**: ALWAYS test README.rst and docs/*.rst examples using test files in `coding_agents/` before committing
4880

4981
## Agent Sandbox
5082
- **File Storage**: All files created for documentation, internal testing, or any other purpose must be placed in the `coding_agents/` directory. This is to avoid polluting the root directory.

README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ Quick Start
8989
# Add buyer (prefers low price) and seller (prefers high price)
9090
session.add(
9191
TimeBasedConcedingNegotiator(name="buyer"),
92-
ufun=LUFun.random(issues, reserved_value=0.0),
92+
ufun=LUFun.random(issues=issues, reserved_value=0.0),
9393
)
9494
session.add(
9595
TimeBasedConcedingNegotiator(name="seller"),
96-
ufun=LUFun.random(issues, reserved_value=0.0),
96+
ufun=LUFun.random(issues=issues, reserved_value=0.0),
9797
)
9898
9999
# Run and get result
@@ -280,19 +280,19 @@ Subclass a base negotiator and implement the required methods:
280280
Composition (Ensemble Approach)
281281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
282282

283-
Use ``SAOMetaNegotiator`` to combine multiple negotiators and aggregate their decisions:
283+
Use ``SAOAggMetaNegotiator`` to combine multiple negotiators and aggregate their decisions:
284284

285285
.. code-block:: python
286286
287287
from negmas.sao import SAOMechanism, ResponseType
288288
from negmas.sao.negotiators import (
289-
SAOMetaNegotiator,
289+
SAOAggMetaNegotiator,
290290
BoulwareTBNegotiator,
291291
NaiveTitForTatNegotiator,
292292
)
293293
294294
295-
class MajorityVoteNegotiator(SAOMetaNegotiator):
295+
class MajorityVoteNegotiator(SAOAggMetaNegotiator):
296296
"""An ensemble negotiator that uses majority voting."""
297297
298298
def aggregate_proposals(self, state, proposals, dest=None):
@@ -471,6 +471,7 @@ Selected papers (see `full list <https://negmas.readthedocs.io/en/latest/publica
471471
**Core NegMAS Research** (by the NegMAS authors)
472472

473473
- Mohammad, Y. (2025). `Tackling the Protocol Problem in Automated Negotiation <https://www.ifaamas.org/Proceedings/aamas2025/pdfs/p246.pdf>`_. AAMAS. *Cited by 1*
474+
- Florijn et al. (2025). `A Survey on One-to-Many Negotiation <https://www.ijcai.org/proceedings/2025/928>`_. IJCAI. *Cited by 1*
474475
- Mohammad, Y. et al. (2024). `Automated Negotiation in Supply Chains: A Generalist Environment for RL/MARL <https://doi.org/10.1007/978-981-96-1072-1_1>`_. PRIMA. *Cited by 1*
475476
- Mohammad, Y. (2023). `Generalized Bargaining Protocols <https://doi.org/10.1007/978-981-99-8391-9_27>`_. AI 2023. *Cited by 3*
476477
- Mohammad, Y. (2023). `Optimal Time-based Strategy for Automated Negotiation <https://doi.org/10.1007/s10489-022-03893-x>`_. Applied Intelligence. *Cited by 9*
@@ -483,6 +484,7 @@ Selected papers (see `full list <https://negmas.readthedocs.io/en/latest/publica
483484

484485
**Competition & Benchmarks**
485486

487+
- Aydoğan et al. (2025). `ANAC 2024 Challenges and Results <https://www.ifaamas.org/Proceedings/aamas2025/pdfs/p2640.pdf>`_. AAMAS. *Cited by 2*
486488
- Aydoğan et al. (2020). `Challenges and Main Results of ANAC 2019 <https://doi.org/10.1007/978-3-030-66412-1_23>`_. EUMAS/AT. *Cited by 51*
487489

488490
**Negotiation Strategies**

docs/modules/genius.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Usage Example
6161
issues = [make_issue(10, "price"), make_issue(5, "quantity")]
6262
6363
# Create utility functions for each negotiator
64-
ufun1 = LinearAdditiveUtilityFunction.random(issues, reserved_value=0.0)
65-
ufun2 = LinearAdditiveUtilityFunction.random(issues, reserved_value=0.0)
64+
ufun1 = LinearAdditiveUtilityFunction.random(issues=issues, reserved_value=0.0)
65+
ufun2 = LinearAdditiveUtilityFunction.random(issues=issues, reserved_value=0.0)
6666
6767
# Create negotiators
6868
n1 = GHardHeaded(name="buyer", ufun=ufun1)
@@ -240,27 +240,25 @@ Example using a Bayesian opponent model with a custom negotiator:
240240

241241
.. code-block:: python
242242
243-
from negmas.gb import GBNegotiator
244-
from negmas.gb.components.genius import (
245-
GBayesianModel,
243+
from negmas.gb.negotiators.modular import BOANegotiator
244+
from negmas.gb.components import (
246245
GTimeDependentOffering,
247-
GACNext,
246+
GACTime,
248247
)
249248
from negmas.sao import SAOMechanism
250249
from negmas.preferences import LinearAdditiveUtilityFunction
251250
from negmas.outcomes import make_issue
252251
253252
# Create scenario
254253
issues = [make_issue(10, "price"), make_issue(5, "quantity")]
255-
ufun = LinearAdditiveUtilityFunction.random(issues, reserved_value=0.0)
254+
ufun = LinearAdditiveUtilityFunction.random(issues=issues, reserved_value=0.0)
256255
257-
# Create negotiator with Bayesian opponent modeling
258-
negotiator = GBNegotiator(
259-
name="bayesian_agent",
256+
# Create negotiator with BOA components
257+
negotiator = BOANegotiator(
258+
name="boa_agent",
260259
ufun=ufun,
261260
offering=GTimeDependentOffering(e=0.5),
262-
acceptance=GACNext(),
263-
model=GBayesianModel(n_hypotheses=20, rationality=5.0),
261+
acceptance=GACTime(t=0.95),
264262
)
265263
266264
The ``GBayesianModel`` maintains multiple hypotheses about opponent preferences and

docs/negotiation_mechanisms.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ turns proposing and responding to offers.
4444
mechanism = SAOMechanism(issues=issues, n_steps=100)
4545
4646
# Add negotiators
47-
mechanism.add(AspirationNegotiator(name="buyer"), ufun=U.random(issues))
48-
mechanism.add(AspirationNegotiator(name="seller"), ufun=U.random(issues))
47+
mechanism.add(AspirationNegotiator(name="buyer"), ufun=U.random(issues=issues))
48+
mechanism.add(AspirationNegotiator(name="seller"), ufun=U.random(issues=issues))
4949
5050
# Run negotiation
5151
mechanism.run()

docs/negotiators.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,8 @@ Using Native Negotiators
871871
872872
# Run negotiation
873873
mechanism = SAOMechanism(issues=issues, n_steps=100)
874-
mechanism.add(negotiator1, ufun=U.random(issues))
875-
mechanism.add(negotiator2, ufun=U.random(issues))
874+
mechanism.add(negotiator1, ufun=U.random(issues=issues))
875+
mechanism.add(negotiator2, ufun=U.random(issues=issues))
876876
mechanism.run()
877877
878878
Using Python-Native Genius Negotiators (Recommended)
@@ -896,8 +896,8 @@ These negotiators don't require Java or the Genius bridge.
896896
897897
# Run negotiation
898898
mechanism = SAOMechanism(issues=issues, n_steps=100)
899-
mechanism.add(negotiator1, ufun=U.random(issues))
900-
mechanism.add(negotiator2, ufun=U.random(issues))
899+
mechanism.add(negotiator1, ufun=U.random(issues=issues))
900+
mechanism.add(negotiator2, ufun=U.random(issues=issues))
901901
mechanism.run()
902902
903903
Using Genius Bridge Negotiators
@@ -930,7 +930,7 @@ Creating Custom Negotiators
930930
NegMAS offers two approaches to creating custom negotiators:
931931

932932
1. **Inheritance**: Subclass a base negotiator and override methods
933-
2. **Composition**: Combine multiple negotiators using ``SAOMetaNegotiator``
933+
2. **Composition**: Combine multiple negotiators using ``SAOAggMetaNegotiator``
934934

935935
Inheritance (Traditional Approach)
936936
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -970,14 +970,14 @@ Subclass a base negotiator and implement the required methods:
970970
Composition (Ensemble Approach)
971971
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
972972

973-
Use ``SAOMetaNegotiator`` to combine multiple negotiators and aggregate their decisions.
973+
Use ``SAOAggMetaNegotiator`` to combine multiple negotiators and aggregate their decisions.
974974
This is useful for ensemble strategies, voting mechanisms, or dynamic strategy switching.
975975

976976
.. code-block:: python
977977
978978
from negmas.sao import SAOMechanism, ResponseType
979979
from negmas.sao.negotiators import (
980-
SAOMetaNegotiator,
980+
SAOAggMetaNegotiator,
981981
BoulwareTBNegotiator,
982982
NaiveTitForTatNegotiator,
983983
AspirationNegotiator,
@@ -986,7 +986,7 @@ This is useful for ensemble strategies, voting mechanisms, or dynamic strategy s
986986
from negmas.outcomes import make_issue, make_os
987987
988988
989-
class MajorityVoteNegotiator(SAOMetaNegotiator):
989+
class MajorityVoteNegotiator(SAOAggMetaNegotiator):
990990
"""An ensemble negotiator that uses majority voting."""
991991
992992
def aggregate_proposals(self, state, proposals, dest=None):
@@ -1032,6 +1032,14 @@ The ensemble approach is useful for:
10321032
- **Dynamic delegation**: Switch between strategies at runtime
10331033
- **A/B testing**: Compare strategies within the same negotiation
10341034

1035+
.. note::
1036+
**Important Consideration**: Sub-negotiators within an ensemble may behave differently
1037+
than they would in isolation. Their recommended offers and decisions are not guaranteed
1038+
to be executed in the actual negotiation, which may break implicit assumptions they make
1039+
about the negotiation flow. For example, a negotiator that expects its offers to be sent
1040+
in sequence may not work as intended if the ensemble aggregator selects offers from
1041+
different sub-negotiators.
1042+
10351043
.. note::
10361044
``GBMetaNegotiator`` is also available for GB (General Bargaining) protocols
10371045
with additional callbacks for partner events.

docs/publications.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ This page lists papers that cite, use, or mention NegMAS and its ecosystem (incl
55

66
.. note::
77

8-
This list is updated periodically. If you have published a paper using NegMAS that is not listed here,
9-
please `open an issue <https://github.com/yasserfarouk/negmas/issues>`_ or submit a pull request.
8+
This list is updated periodically using LLMs by searching academic databases.
9+
While we strive for accuracy, the automated process may occasionally miss papers or include
10+
incorrect information. Please **double check** these citations before reusing them.
11+
If you have published a paper using NegMAS that is not listed here,
12+
or if you notice any inaccuracies, please `open an issue <https://github.com/yasserfarouk/negmas/issues>`_
13+
or submit a pull request.
1014

1115
*Last updated: February 2026*
1216

@@ -88,6 +92,10 @@ Papers presenting novel negotiation strategies using NegMAS:
8892
`Predicting the Outcome of Ongoing Automated Negotiations <https://doi.org/10.1007/978-981-96-1072-1_7>`_.
8993
In: *PRIMA 2024*. LNCS. Springer.
9094

95+
- 清水拓夢, 藤田桂英 (2024).
96+
`サプライチェーンにおける合意可能価格予測を考慮した自動交渉戦略 <https://ipsj.ixsq.nii.ac.jp/ej/?action=pages_view_main&active_action=repository_view_main_item_detail&item_id=235829&item_no=1&page_id=13&block_id=8>`_.
97+
情報処理学会論文誌 (IPSJ Journal). *Cited by 1*
98+
9199
- Aguilera-Luzon, D., de Jonge, D., Larrosa, J. (2025).
92100
`MiCRO for Multilateral Negotiations <https://doi.org/10.1007/978-981-96-1072-1_6>`_.
93101
In: *PRIMA 2024*. LNCS. Springer.
@@ -178,6 +186,10 @@ Papers on negotiation protocols and theoretical aspects:
178186
`A Survey on One-to-Many Negotiation: A Taxonomy of Interdependency <https://www.ijcai.org/proceedings/2025/928>`_.
179187
In: *Proceedings of IJCAI 2025*. *Cited by 1*
180188

189+
- de Jonge, D. (2025).
190+
`BINGO: An Algorithm for Automated Negotiations with Hidden Reservation Values <https://iiia.csic.es/~davedejonge/homepage/papers/bingo.pdf>`_.
191+
Technical Report.
192+
181193
- de Jonge, D. (2025).
182194
`Introduction to Automated Negotiation <https://arxiv.org/abs/2511.08659>`_.
183195
arXiv:2511.08659.
@@ -230,17 +242,13 @@ Papers describing other platforms that use or compare with NegMAS:
230242
`NegoSim: A Modular and Extendable Automated Negotiation Simulation Platform Considering EUBOA <https://doi.org/10.3390/app13179396>`_.
231243
*Applied Sciences*. *Cited by 7*
232244

233-
- Keskin, M.O., Buzcu, B., Koçyiğit, B., et al. (2024).
234-
`NEGOTIATOR: A Comprehensive Framework for Human-Agent Negotiation <https://doi.org/10.1145/3652988.3673933>`_.
235-
In: *Proceedings of AAMAS 2024*. *Cited by 2*
236-
237245
- Doğru, A., Keskin, M.O., Aydoğan, R. (2025).
238246
`Taking into Account Opponent's Arguments in Human-Agent Negotiations <https://doi.org/10.1145/3701460>`_.
239247
*ACM Transactions on Interactive Intelligent Systems*. *Cited by 3*
240248

241-
- de Jonge, D. (2025).
242-
`BINGO: An Algorithm for Automated Negotiations with Hidden Reservation Values <https://iiia.csic.es/~davedejonge/homepage/papers/bingo.pdf>`_.
243-
Technical Report.
249+
- Keskin, M.O., Buzcu, B., Koçyiğit, B., et al. (2024).
250+
`NEGOTIATOR: A Comprehensive Framework for Human-Agent Negotiation <https://doi.org/10.1145/3652988.3673933>`_.
251+
In: *Proceedings of AAMAS 2024*. *Cited by 2*
244252

245253

246254
Applications

0 commit comments

Comments
 (0)