ANL 2025 Reference
This package provides a wrapper around NegMAS functionality to generate and run tournaments a la ANL 2025 competition.
You mostly only need to use anl2025_tournament
in your code. The other helpers are provided to allow for a finer control over the scenarios used.
Negotiators (Agents)
The package provides few example negotiators. Of special importance is the MiCRO
negotiator which provides a full implementation of a recently proposed behavioral strategy.
Other negotiators are just wrappers over negotiators provided by NegMAS.
anl2025.negotiator.ANL2025Negotiator
Bases: SAOController
Base class of all participant code.
See the next two examples of how to implement it (Boulware2025
, Random2025
).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_edges
|
int
|
Number of edges for this negotiator. You can access it using self._n_edges |
0
|
update_side_ufuns_on_end
|
bool
|
Updates the expected outcome for each thread at the end of each negotiation threads. These expected values are used when a side-negotiator calculates its side-utility. |
True
|
update_side_ufuns_after_receiving_offers
|
bool
|
Updates expected outcome for each thread whenever an offer is received from a partner |
False
|
update_side_ufuns_after_offering
|
bool
|
Updates the expected outcome for each thread after it is offered (i.e. assume the opponent will accept). |
False
|
auto_kill
|
bool
|
Removes negotiators from the self.negotiators list whenever the negotiation ends. |
False
|
Remarks
- This class provides some useful members that can be used when developing the negotiation strategy:
self.ufun
: TheCenterUFun
for the center negotiator (for edge negotiators, it will be a normal negmas ufun).self.negotiators
: Returns a dict mapping negotiator-IDs (for side negotiators) to the corresponding negotiator and context. You can use the returned negotiator to access theNMI
(Negotiator-Mechanism-Interface) for this side negotiator which in turn have access to the state and other services provided by negmas NMIs. The context has the following members:ufun
: The side ufun for the thread.center
: A boolean indicating whether this is a side negotiator for a center or is an edge negotiator.index
: The thread index for this thread.self.active_negotiators
/self.started_negotiators
/self.to_start_negotiators
/self.finished_negotiators
/self.unfinished_negotiators
Same asself.negotiators
but with the corresponding subset of negotiators only.
Methods:
Name | Description |
---|---|
init |
Called after all mechanisms are created to initialize |
propose |
Called to propose an offer for one of the edge negotiators |
respond |
Called to respond to an offer from an edge negotiator |
set_expected_outcome |
Sets the expected value for a negotiation thread. |
thread_finalize |
Called when a negotiation thread ends |
thread_init |
Called when a negotiation thread starts |
Source code in anl2025/negotiator.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
init
Called after all mechanisms are created to initialize
Remarks
- self.negotiators can be used to access the threads.
- Each has a negotiator object and a cntxt object.
- We can pass anything in the cntxt. Currently, we pass the side ufun
- Examples:
- Access the CenterUFun associated with the agent. For edge agents, this will be the single ufun it uses. my_ufun = self.ufun
- Access the side ufun associated with each thread. For edge agents this will be the single ufun it uses. my_side_ufuns = [info.context["ufun"] for neg_id, info in self.negotiators.items()] my_side_indices = [info.context["index"] for neg_id, info in self.negotiators.items()] my_side_is_center = [info.context["center"] for neg_id, info in self.negotiators.items()]
- Access the side negotiators connected to different negotiation threads my_side_negotiators = [info.negotiator for neg_id, info in self.negotiators.items()]
Source code in anl2025/negotiator.py
propose
Called to propose an offer for one of the edge negotiators
Parameters:
Name | Type | Description | Default |
---|---|---|---|
negotiator_id
|
str
|
The ID of the connection to the edge negotiator. |
required |
state
|
SAOState
|
The state of the negotiation with this edge negotiator. |
required |
dest
|
str | None
|
The ID of the edge negotiator |
None
|
Returns:
Type | Description |
---|---|
Outcome | ExtendedOutcome | None
|
An outcome to offer. In ANL2025, |
Source code in anl2025/negotiator.py
respond
Called to respond to an offer from an edge negotiator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
negotiator_id
|
str
|
The ID of the connection to the edge negotiator. |
required |
state
|
SAOState
|
The state of the negotiation with this edge negotiator. |
required |
dest
|
The ID of the edge negotiator |
required |
Returns:
Type | Description |
---|---|
ResponseType
|
A response (Accept, Reject, or End_Negotiation) |
Remarks
- The current offer on the negotiation thread with this edge
negotiator can be accessed as
state.current_offer
.
Source code in anl2025/negotiator.py
set_expected_outcome
Sets the expected value for a negotiation thread.
Source code in anl2025/negotiator.py
thread_finalize
Called when a negotiation thread ends
Parameters:
Name | Type | Description | Default |
---|---|---|---|
negotiator_id
|
str
|
Connection ID to this negotiation thread |
required |
state
|
SAOState
|
The state of the negotiation thread at the end of the negotiation. |
required |
Source code in anl2025/negotiator.py
thread_init
Called when a negotiation thread starts
Parameters:
Name | Type | Description | Default |
---|---|---|---|
negotiator_id
|
str
|
Connection ID to this negotiation thread |
required |
state
|
SAOState
|
The state of the negotiation thread at the start of the negotiation. |
required |
Source code in anl2025/negotiator.py
anl2025.negotiator.Random2025
Bases: ANL2025Negotiator
The most general way to implement an agent is to implement propose and respond.
Methods:
Name | Description |
---|---|
propose |
Proposes to the given partner (dest) using the side negotiator (negotiator_id). |
respond |
Responds to the given partner (source) using the side negotiator (negotiator_id). |
Source code in anl2025/negotiator.py
propose
Proposes to the given partner (dest) using the side negotiator (negotiator_id).
Remarks:
Source code in anl2025/negotiator.py
respond
Responds to the given partner (source) using the side negotiator (negotiator_id).
Remarks
- source: is the ID of the partner.
- the mapping from negotiator_id to source is stable within a negotiation.
Source code in anl2025/negotiator.py
anl2025.negotiator.TimeBased2025
Bases: ANL2025Negotiator
A time-based conceding agent
Methods:
Name | Description |
---|---|
ensure_inverter |
Ensures that utility inverter is available |
propose |
Proposes to the given partner (dest) using the side negotiator (negotiator_id). |
respond |
Responds to the given partner (source) using the side negotiator (negotiator_id). |
Source code in anl2025/negotiator.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
|
ensure_inverter
Ensures that utility inverter is available
Source code in anl2025/negotiator.py
propose
Proposes to the given partner (dest) using the side negotiator (negotiator_id).
Remarks:
Source code in anl2025/negotiator.py
respond
Responds to the given partner (source) using the side negotiator (negotiator_id).
Remarks
- source: is the ID of the partner.
- the mapping from negotiator_id to source is stable within a negotiation.
Source code in anl2025/negotiator.py
anl2025.negotiator.Boulware2025
anl2025.negotiator.Linear2025
anl2025.negotiator.Conceder2025
anl2025.negotiator.IndependentBoulware2025
Bases: ANL2025Negotiator
You can participate by an agent that runs any SAO negotiator independently for each thread.
Source code in anl2025/negotiator.py
anl2025.negotiator.IndependentLinear2025
Bases: ANL2025Negotiator
You can participate by an agent that runs any SAO negotiator independently for each thread.
Source code in anl2025/negotiator.py
anl2025.negotiator.IndependentConceder2025
Bases: ANL2025Negotiator
You can participate by an agent that runs any SAO negotiator independently for each thread.
Source code in anl2025/negotiator.py
Utility Functions
anl2025.ufun.CenterUFun
Bases: UtilityFunction
, ABC
Base class of center utility functions.
Remarks
- Can be constructed by either passing a single
outcome_space
andn_edges
or a tuple ofoutcome_spaces
- It's eval() method receives a tuple of negotiation results and returns a float
Methods:
Name | Description |
---|---|
__call__ |
Entry point to calculate the utility of a set of offers (called by the mechanism). |
eval |
Evaluates the utility of a given set of offers. |
eval_with_expected |
Calculates the utility of a set of offers with control over whether or not to use stored expected outcomes. |
side_ufuns |
Should return an independent ufun for each side negotiator of the center. |
ufun_type |
Returns the center ufun category. |
Source code in anl2025/ufun.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
|
__call__
Entry point to calculate the utility of a set of offers (called by the mechanism).
Override to avoid using expected outcomes.
Source code in anl2025/ufun.py
eval
abstractmethod
Evaluates the utility of a given set of offers.
Remarks
- Order matters: The order of outcomes in the offer is stable over all calls.
- A missing offer is represented by
None
Source code in anl2025/ufun.py
eval_with_expected
Calculates the utility of a set of offers with control over whether or not to use stored expected outcomes.
Source code in anl2025/ufun.py
side_ufuns
Should return an independent ufun for each side negotiator of the center.
Source code in anl2025/ufun.py
ufun_type
abstractmethod
Returns the center ufun category.
Currently, we have two categories (Global and Local). See CenterUFunCategory
for
their definitions.
anl2025.ufun.FlatCenterUFun
Bases: UtilityFunction
A flattened version of a center ufun.
A normal CenterUFun takes outcomes as a tuple of outcomes (one for each edge). A flattened version of the same ufun takes input as just a single outcome containing a concatenation of the outcomes in all edges.
Example:
```python
x = CenterUFun(...)
y = x.flatten()
x(((1, 0.5), (3, true), (7,))) == y((1, 0.5, 3, true, 7))
```
Source code in anl2025/ufun.py
anl2025.ufun.LambdaCenterUFun
Bases: CenterUFun
A center utility function that implements an arbitrary evaluator
Source code in anl2025/ufun.py
anl2025.ufun.LambdaUtilityFunction
Bases: UtilityFunction
A utility function that implements an arbitrary mapping
Source code in anl2025/ufun.py
anl2025.ufun.MaxCenterUFun
Bases: UtilityCombiningCenterUFun
The max center ufun.
The utility of the center is the maximum of the utilities it got in each negotiation (called side utilities)
Source code in anl2025/ufun.py
anl2025.ufun.MeanSMCenterUFun
Bases: SingleAgreementSideUFunMixin
, CenterUFun
A ufun that just returns the average mean+std dev. in each issue of the agreements as the utility value
Source code in anl2025/ufun.py
anl2025.ufun.SideUFun
Bases: BaseUtilityFunction
Side ufun corresponding to the i's component of a center ufun.
Source code in anl2025/ufun.py
anl2025.ufun.SingleAgreementSideUFunMixin
Can be mixed with any CenterUFun that is not a combining ufun to create side_ufuns that assume failure on all other negotiations.
See Also
MeanSMCenterUFun
Source code in anl2025/ufun.py
anl2025.ufun.UtilityCombiningCenterUFun
Bases: CenterUFun
A center ufun with a side-ufun defined for each thread.
The utility of the center is a function of the ufuns of the edges.
Methods:
Name | Description |
---|---|
combine |
Combines the utilities of all negotiation threads into a single value |
Source code in anl2025/ufun.py
Utility Function Helpers
anl2025.ufun.convert_to_center_ufun
Creates a center ufun from any standard ufun with ufuns side ufuns
Source code in anl2025/ufun.py
anl2025.ufun.unflatten_outcome_space
Distributes the issues of an outcome-space into a tuple of outcome-spaces.
Source code in anl2025/ufun.py
Scenarios
anl2025.scenario.MultidealScenario
Defines the multi-deal scenario by setting utility functions (and implicitly outcome-spaces)
Methods:
Name | Description |
---|---|
from_folder |
Loads a multi-deal scenario from the given folder. |
to_dict |
Converts the scenario to a dictionary |
Source code in anl2025/scenario.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
from_folder
classmethod
Loads a multi-deal scenario from the given folder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder
|
Path | str
|
The path to load the scenario from |
required |
name
|
str | None
|
The name to give to the scenario. If not given, the folder name |
None
|
edges_know_details
|
If given, edge ufuns will have |
required | |
python_class_identifier
|
str
|
the key in the yaml to define a type. |
TYPE_IDENTIFIER
|
type_marker
|
A marker at the beginning of a string to define a type (for future proofing). |
f'{TYPE_IDENTIFIER}:'
|
Source code in anl2025/scenario.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
to_dict
Converts the scenario to a dictionary
Source code in anl2025/scenario.py
anl2025.scenario.make_multideal_scenario
Source code in anl2025/scenario.py
anl2025.scenarios.make_dinners_scenario
Creates a variation of the Dinners multideal scenario
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_friends
|
int
|
Number of friends. |
3
|
n_days
|
int | None
|
Number of days. If |
None
|
friend_names
|
tuple[str, ...] | None
|
Optionally, list of friend names (otherwise we will use Friend{i}) |
None
|
center_reserved_value
|
tuple[float, float] | float
|
The reserved value of the center. Either a number of a min-max range |
0.0
|
edge_reserved_valus
|
The reserved value of the friends (edges). Always, a min-max range |
required | |
values
|
dict[tuple[int, ...], float] | None
|
A mapping from the number of dinners per day (a tuple of n_days integers) to utility value of the center |
None
|
public_graph
|
bool
|
Should edges know n_edges and outcome_spaces? |
True
|
Returns:
Type | Description |
---|---|
MultidealScenario
|
An initialized |
Source code in anl2025/scenarios/dinners.py
anl2025.scenarios.make_target_quantity_scenario
Creates a target-quantity type scenario
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_suppliers
|
IntRange
|
Number of suppliers (sources/sellers) |
4
|
quantity
|
IntRange
|
The range of values for each supplier (if an integer, then the range is (0, quanityt-1)) |
(1, 5)
|
target_quantity
|
IntRange
|
The target quantity of the collector (buyer) |
(2, 20)
|
shortfall_penalty
|
FloatRange
|
The collector's penalty for buying an item less than target. Can be a range to sample form it |
(0.1, 0.3)
|
excess_penalty
|
FloatRange
|
The penalty for buying an item more than target. Can be a range to sample form it |
(0.1, 0.4)
|
public_graph
|
bool
|
Whether edges (suppliers) know n_edges and outcome-spaces of the center (collector) |
True
|
supplier_names
|
list[str] | None
|
Names of suppliers |
None
|
collector_name
|
str
|
Name of the collector |
'Collector'
|
collector_reserved_value
|
FloatRange
|
Range or a single value for collector's reserved value |
0.0
|
supplier_reserved_values
|
FloatRange
|
Range or a single value for supplier's reserved value |
0.0
|
supplier_shortfall_penalty
|
FloatRange | None
|
suppliers' penalty for buying an item less than their target. Can be a range to sample form it |
(0.3, 0.9)
|
supplier_excess_penalty
|
FloatRange | None
|
suppliers' penalty for buying an item more than their target. Can be a range to sample form it |
(0.3, 0.9)
|
Remarks
- Supplier's target value is sampled uniformly from the range of values
Source code in anl2025/scenarios/target_quantity.py
anl2025.scenarios.make_job_hunt_scenario
Source code in anl2025/scenarios/job_hunt.py
anl2025.scenarios.get_example_scenario_names
anl2025.scenarios.load_example_scenario
Loads an example scenario.
Remarks
- Currently the following scenarios are available: Dinners and TargetQuantity.
- If you do not pass any name a randomly chosen example scenario will be returned.
Source code in anl2025/scenarios/__init__.py
Sessions
anl2025.runner.run_session
Runs a multideal negotiation session and runs it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenario
|
MultidealScenario
|
The negotiation scenario (must be |
required |
method
|
the method to use for running all the sessions.
Acceptable options are: sequential, ordered, threads, processes.
See |
DEFAULT_METHOD
|
|
center_type
|
str | type[ANL2025Negotiator]
|
Type of the center agent |
'Boulware2025'
|
center_params
|
dict[str, Any] | None
|
Optional parameters to pass to the center agent. |
None
|
center_ufun_type
|
Type of the center agent ufun. |
required | |
center_ufun_params
|
Parameters to pass to the center agent ufun. |
required | |
edge_types
|
list[str | type[ANL2025Negotiator]]
|
Types of edge agents |
[Boulware2025, Linear2025, Conceder2025]
|
nsteps
|
int
|
Number of negotiation steps. |
100
|
keep_order
|
bool
|
Keep the order of edges when advancing the negotiation. |
True
|
share_ufuns
|
bool
|
If given, agents will have access to partner ufuns through |
True
|
atomic
|
bool
|
If given, one step corresponds to one offer instead of a full round. |
False
|
output
|
Path | None
|
Folder to store the logs and results within. |
home() / 'negmas' / 'anl2025' / 'session'
|
name
|
str
|
Name of the session |
''
|
dry
|
bool
|
IF true, nothing will be run. |
False
|
verbose
|
bool
|
Print progress |
False
|
sample_edges
|
bool
|
If true, the |
False
|
Returns:
Type | Description |
---|---|
SessionResults
|
|
Source code in anl2025/runner.py
anl2025.runner.run_generated_session
Generates a multideal negotiation session and runs it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method
|
the method to use for running all the sessions.
Acceptable options are: sequential, ordered, threads, processes.
See |
DEFAULT_METHOD
|
|
center_type
|
str
|
Type of the center agent |
'Boulware2025'
|
center_params
|
dict[str, Any] | None
|
Optional parameters to pass to the center agent. |
None
|
center_reserved_value_min
|
float
|
Minimum reserved value for the center agent. |
0.0
|
center_reserved_value_max
|
float
|
Maximum reserved value for the center agent. |
0.0
|
center_ufun_type
|
str | type[CenterUFun]
|
Type of the center agent ufun. |
'MaxCenterUFun'
|
center_ufun_params
|
dict[str, Any] | None
|
Parameters to pass to the center agent ufun. |
None
|
nedges
|
int
|
Number of edges. |
10
|
edge_reserved_value_min
|
float
|
Minimum reserved value for edges. |
0.1
|
edge_reserved_value_max
|
float
|
Maximum reserved value for edges. |
0.4
|
edge_types
|
list[str | type[ANL2025Negotiator]]
|
Types of edge agents |
[Boulware2025, Random2025, Linear2025, Conceder2025]
|
nissues
|
int
|
Number of issues to use for each thread. |
3
|
nvalues
|
int
|
Number of values per issue for each thread. |
7
|
nsteps
|
int
|
Number of negotiation steps. |
100
|
keep_order
|
bool
|
Keep the order of edges when advancing the negotiation. |
True
|
share_ufuns
|
bool
|
If given, agents will have access to partner ufuns through |
True
|
atomic
|
bool
|
If given, one step corresponds to one offer instead of a full round. |
False
|
output
|
Path | str | None
|
Folder to store the logs and results within. |
home() / 'negmas' / 'anl2025' / 'session'
|
name
|
str
|
Name of the session |
''
|
dry
|
bool
|
IF true, nothing will be run. |
False
|
verbose
|
bool
|
Print progress |
False
|
Returns:
Type | Description |
---|---|
SessionResults
|
|
Source code in anl2025/runner.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
|
anl2025.runner.RunParams
Defines the running parameters of the multi-deal negotiation like time-limits.
Attributes:
Name | Type | Description |
---|---|---|
nsteps |
int
|
Number of negotiation steps |
keep_order |
bool
|
Keep the order of negotiation threads when scheduling next action |
share_ufuns |
bool
|
If given, agents can access partner ufuns through |
atomic |
bool
|
Every step is a single offer (if not given, on the other hand, every step is a complete round) |
method |
str
|
the method to use for running all the sessions. Acceptable options are: sequential,
ordered, threads, processes. See |
time_limit |
float | None
|
Number of seconds allowed per negotiation |
Source code in anl2025/common.py
anl2025.runner.SessionResults
Results of a single multideal negotiation
Attributes:
Name | Type | Description |
---|---|---|
mechanisms |
list[SAOMechanism]
|
The mechanisms representing negotiation threads. |
center |
ANL2025Negotiator
|
The center agent |
edges |
list[ANL2025Negotiator]
|
Edge agents |
agreements |
list[Outcome | None]
|
Negotiation outcomes for all threads. |
center_utility |
float
|
The utility received by the center. |
edge_utilities |
list[float]
|
The utilities of all edges. |
Source code in anl2025/runner.py
Tournaments
anl2025.tournament.Tournament
Represents a tournament
Attributes:
Name | Type | Description |
---|---|---|
competitors |
tuple[str | type[ANL2025Negotiator], ...]
|
the competing agents of type |
scenarios |
tuple[MultidealScenario, ...]
|
the scenarios in which the competitors are tested |
run_params |
RunParams
|
parameters controlling the tournament run (See |
competitor_params |
tuple[dict[str, Any] | None, ...] | None
|
Parameters to pass to the competitors |
Methods:
Name | Description |
---|---|
from_scenarios |
Loads a tournament from the given scenarios (optionally generating new ones) |
load |
Loads the tournament information. |
run |
Run the tournament |
save |
Saves the tournament information. |
Source code in anl2025/tournament.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
from_scenarios
classmethod
Loads a tournament from the given scenarios (optionally generating new ones)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
competitors
|
Sequence[str | type[ANL2025Negotiator]]
|
Competing agents |
required |
run_params
|
RunParams
|
|
required |
scenarios
|
tuple[MultidealScenario, ...]
|
An optional tuple of predefined scenarios ( |
tuple()
|
n_generated
|
int
|
Number of new scenarios to generate |
0
|
nedges
|
int
|
Number of negotiation threads (only used if |
3
|
nissues
|
int
|
Number of negotiation issues per thread (only used if |
3
|
nvalues
|
int
|
Number of values per issue (only used if |
7
|
center_reserved_value_min
|
float
|
Minimum reserved value of the center for generated scenarios. |
0.0
|
center_reserved_value_max
|
float
|
Maximum reserved value of the center for generated scenarios. |
0.0
|
center_ufun_type
|
str | type[CenterUFun]
|
center agent ufun for generated scenarios. |
'MaxCenterUFun'
|
center_ufun_params
|
dict[str, Any] | None
|
center agent ufun params for generated scenarios. |
None
|
edge_reserved_value_min
|
float
|
Minimum reserved value of edges for generated scenarios. |
0.1
|
edge_reserved_value_max
|
float
|
Maximum reserved value of edges for generated scenarios. |
0.4
|
competitor_params
|
tuple[dict[str, Any] | None, ...] | None
|
Optional competitor paramters |
None
|
Returns:
Type | Description |
---|---|
Self
|
A |
Source code in anl2025/tournament.py
load
classmethod
Loads the tournament information.
Source code in anl2025/tournament.py
run
Run the tournament
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_repetitions
|
int
|
Number of repetitions of rotations over scenarios |
required |
path
|
Path | str | None
|
Path to save the results to |
None
|
verbose
|
bool
|
Print progress |
False
|
dry
|
bool
|
Do not really run the negotiations. |
False
|
no_double_scores
|
bool
|
Avoid having the same agent in multiple positions in the same negotiation |
True
|
non_comptitor_types
|
tuple[str | type[ANL2025Negotiator], ...] | None
|
Types to use to fill missing edge locations if not enough competitors are available |
None
|
non_comptitor_params
|
tuple[dict[str, Any], ...] | None
|
Paramters of non-competitor-types |
None
|
n_jobs
|
int | float | None
|
Number of parallel jobs to use. None (and negative numbers) mean serially, 0 means use all cores, fractions mean fraction of available cores, integers mean exact number of cores |
0
|
center_multiplier
|
float | None
|
A number to multiply center utilities with before calculating the score. Can be used to give more or less value to being a center. If None, it will be equal to the number of edges. |
None
|
edge_multiplier
|
float
|
A number to multiply edge utilities with before calculating the score. Can be used to give more or less value to being an edge |
1
|
Returns:
Type | Description |
---|---|
TournamentResults
|
|
Source code in anl2025/tournament.py
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
save
Saves the tournament information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path | str
|
A file to save information about the tournament to |
required |
separate_scenarios
|
bool
|
If |
False
|