SimpleTournamentResults

class negmas.tournaments.SimpleTournamentResults(scores: DataFrame, details: DataFrame, scores_summary: DataFrame, final_scores: DataFrame, path: Path | None = 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, ...])

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: Path | Iterable[Path], recursive: bool = True, recalc_details: bool = True, recalc_scores: bool = False, must_have_details: bool = False, verbosity: int = 1, final_score_stat: tuple[str, str] = ('advantage', 'mean'), add_tournament_column: bool = True, complete_only: bool = True) tuple[SimpleTournamentResults, list[Path]][source]

Combines the results of multiple tournaments stored on disk

Parameters:
  • paths – Paths to look for results within

  • recursive – Check children of given paths recursively

  • recalc_details – Recalculate detailed results from the negotiations folder

  • recalc_scores – Recalculate scores from detailed negotiation results

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

  • verbosity – Verbosity level

  • final_score_stat – Used to calculate the final scores. See cartesian_tournament for details.

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

  • complete_only – If given, only a completed tournament will be used in the combination. The rest are ignored.

Raises:

FileNotFoundError – If a needed file is not found

Returns:

A newly constructed SimpleTournamentResults with the combined results of all tournaments

classmethod from_records(scores: list[dict[str, Any]] | DataFrame | None = None, results: list[dict[str, Any]] | DataFrame | None = None, type_scores: DataFrame | None = None, final_scores: DataFrame | None = None, final_score_stat: tuple[str, str] = ('advantage', 'mean'), path: Path | None = None) SimpleTournamentResults[source]

Creates SimpleTournamentResults from records of results

Parameters:
  • scores – The scores of negotiators in all negotiations (If not given, results can be used to calculate it).

  • results – Results of all negotiations (If not given, the resulting SimpleTournamentResults object will lack details)

  • type_scores – Optionally, type-scores. If not given, it will be calculated from scores

  • final_scores – Optionally, final scores. If not given, final_scoer_stat will be used to calculate them

  • final_score_stat – A tuple of the measure used and the statistic applied to it for calculating final score. See cartesian_tournament for more details

  • path – The path in which the data for this tournament is stored.

Raises:

ValueError – If no scores or results are given

Returns:

A new SimpleTournamentResults with the given data

classmethod from_result_records(path: Path, verbosity: int = 1, final_score_stat: tuple[str, str] = ('advantage', 'mean')) SimpleTournamentResults[source]
classmethod load(path: Path, must_have_details: bool = False) SimpleTournamentResults[source]

Loads results from the given path

save(path: Path | None, exist_ok: bool = True) None[source]

Save all results to the given path