SimpleTournamentResults

class negmas.tournaments.SimpleTournamentResults(scores, details, scores_summary, final_scores, path=None)[source]

Bases: object

Attributes Summary

details

All negotiation results

final_scores

A list of negotiators and their final scores sorted from highest (winner) to lowest score

path

Location at which the logs are stored

scores

All scores per negotiator

scores_summary

All score statistics summarized per type

Methods Summary

combine(paths[, recursive, recalc_details, ...])

Combines the results of multiple tournaments stored on disk

from_records([scores, results, type_scores, ...])

Creates SimpleTournamentResults from records of results

from_result_records(path[, verbosity, ...])

rtype:

SimpleTournamentResults

load(path[, must_have_details])

Loads results from the given path

save(path[, exist_ok])

Save all results to the given path

Attributes Documentation

details: DataFrame

All negotiation results

final_scores: DataFrame

A list of negotiators and their final scores sorted from highest (winner) to lowest score

path: Path | None

Location at which the logs are stored

scores: DataFrame

All scores per negotiator

scores_summary: DataFrame

All score statistics summarized per type

Methods Documentation

classmethod combine(paths, recursive=True, recalc_details=True, recalc_scores=False, must_have_details=False, verbosity=1, final_score_stat=('advantage', 'mean'), add_tournament_column=True)[source]

Combines the results of multiple tournaments stored on disk

Parameters:
  • paths (Union[Path, Iterable[Path]]) – Paths to look for results within

  • recursive (bool) – Check children of given paths recursively

  • recalc_details (bool) – Recalculate detailed results from the negotiations folder

  • recalc_scores (bool) – Recalculate scores from detailed negotiation results

  • must_have_details (bool) – Raise an exception if detailed negotiation results cannot be found

  • verbosity (int) – Verbosity level

  • final_score_stat (tuple[str, str]) – Used to calculate the final scores. See cartesian_tournament for details.

  • add_tournament_column (bool) – Add a column called tournament with tournament name in detailed and scores.

Raises:

FileNotFoundError – If a needed file is not found

Return type:

tuple[SimpleTournamentResults, list[Path]]

Returns:

A newly constructed SimpleTournamentResults with the combined results of all tournaments

classmethod from_records(scores=None, results=None, type_scores=None, final_scores=None, final_score_stat=('advantage', 'mean'), path=None)[source]

Creates SimpleTournamentResults from records of results

Parameters:
  • scores (list[dict[str, Any]] | DataFrame | None) – The scores of negotiators in all negotiations (If not given, results can be used to calculate it).

  • results (list[dict[str, Any]] | DataFrame | None) – Results of all negotiations (If not given, the resulting SimpleTournamentResults object will lack details)

  • type_scores (DataFrame | None) – Optionally, type-scores. If not given, it will be calculated from scores

  • final_scores (DataFrame | None) – Optionally, final scores. If not given, final_scoer_stat will be used to calculate them

  • final_score_stat (tuple[str, str]) – A tuple of the measure used and the statistic applied to it for calculating final score. See cartesian_tournament for more details

  • path (Path | None) – The path in which the data for this tournament is stored.

Raises:

ValueError – If no scores or results are given

Return type:

SimpleTournamentResults

Returns:

A new SimpleTournamentResults with the given data

classmethod from_result_records(path, verbosity=1, final_score_stat=('advantage', 'mean'))[source]
Return type:

SimpleTournamentResults

classmethod load(path, must_have_details=False)[source]

Loads results from the given path

Return type:

SimpleTournamentResults

save(path, exist_ok=True)[source]

Save all results to the given path

Return type:

None