Skip to content

Commit d0caaba

Browse files
committed
Documentation update
1 parent 1074f36 commit d0caaba

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎notebooks/overview.ipynb‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@
725725
{
726726
"data": {
727727
"text/plain": [
728-
"[['to be', '20250315H165549399269jJTGt6qBto be20250315H165549399295XtRgNy0I'],\n",
728+
"[['to be', '20250316H062020000663jJTGt6qBto be20250316H062020000683XtRgNy0I'],\n",
729729
" [6, 10],\n",
730730
" [0.6118970848141451, 1.928063278403899]]"
731731
]
@@ -2982,7 +2982,9 @@
29822982
" current = self.negotiators[nxt]\n",
29832983
" offer = None\n",
29842984
" self.state.current_offer = (\n",
2985-
" current.propose(self.state) if offer is None else offer\n",
2985+
" current.propose(self.state, self.current_offerer)\n",
2986+
" if offer is None\n",
2987+
" else offer\n",
29862988
" )\n",
29872989
"\n",
29882990
" def get_response(negotiator, state=self.state):\n",

‎notebooks/tutorials/03.develop_new_negotiator.ipynb‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,11 @@
261261
"This is telling us that there is one (and only one) required abstract method that we need to override called `propose()`. This is the signature of this method:\n",
262262
"\n",
263263
"```python\n",
264-
"def proposed(self, state: SAOState) -> Outcome:\n",
264+
"def propose(self, state: SAOState, dest: str | None = None) -> Outcome:\n",
265265
" ...\n",
266266
"```\n",
267267
"\n",
268-
"It receives the negotiation `state` which has all information available to the negotiator about the current state of the negotiation and generates an outcome to *offer* to the opponent. That is it. Moreover, we should know that the negotiator always have access to a `NegotiatorMechanismInterface` object that gives it unchanging information about the negotiation (for example the number of allowed rounds, any real-time limits on the negotiation, the number of partners, etc). This interface is accessible through the `nmi` member of the negotiator. With this knowledge, we can build our first negotiator which will simply offer randomly. "
268+
"It receives the negotiation `state` which has all information available to the negotiator about the current state of the negotiation and generates an outcome to *offer* to the opponent. The second parameter (which MUST be optional) is the destination of the offer. That is it. Moreover, we should know that the negotiator always have access to a `NegotiatorMechanismInterface` object that gives it unchanging information about the negotiation (for example the number of allowed rounds, any real-time limits on the negotiation, the number of partners, etc). This interface is accessible through the `nmi` member of the negotiator. With this knowledge, we can build our first negotiator which will simply offer randomly. "
269269
]
270270
},
271271
{
@@ -606,7 +606,7 @@
606606
},
607607
{
608608
"cell_type": "code",
609-
"execution_count": 11,
609+
"execution_count": 25,
610610
"id": "3b66d1c6",
611611
"metadata": {
612612
"papermill": {
@@ -621,7 +621,7 @@
621621
"outputs": [],
622622
"source": [
623623
"class BetterRandomNegotiator(RandomNegotiator):\n",
624-
" def respond(self, state, source: str = \"\"):\n",
624+
" def respond(self, state, source: str | None = None):\n",
625625
" offer = state.current_offer\n",
626626
" if self.ufun(offer) > 0.9:\n",
627627
" return ResponseType.ACCEPT_OFFER\n",
@@ -905,7 +905,8 @@
905905
" super().__init__(*args, **kwargs)\n",
906906
" self._th = acceptance_threshold\n",
907907
"\n",
908-
" def respond(self, state, offer, nid: str):\n",
908+
" def respond(self, state, source: str | None = None):\n",
909+
" offer = state.current_offer\n",
909910
" if self.ufun(offer) > self._th:\n",
910911
" return ResponseType.ACCEPT_OFFER\n",
911912
" return ResponseType.REJECT_OFFER"
@@ -985,7 +986,7 @@
985986
" # MUST call parent to avoid being called again for no reason\n",
986987
" super().on_preferences_changed(changes)\n",
987988
"\n",
988-
" def respond(self, state, source: str):\n",
989+
" def respond(self, state, source: str | None = None):\n",
989990
" offer = state.current_offer\n",
990991
" if offer is None:\n",
991992
" return ResponseType.REJECT_OFFER\n",

0 commit comments

Comments
 (0)