def compute_metrics(strategies, noise=0):
    results = run_tournament("tournament", strategies, noise=noise)
    rows = []
    for i in range(len(results.players)):
        row = [str(results.players[i]), numpy.mean(results.normalised_scores[i]), numpy.mean(results.normalised_cooperation[i]), results.good_partner_rating[i], results.eigenjesus_rating[i], results.eigenmoses_rating[i]]
        rows.append(row)
    return rows
Ejemplo n.º 2
0
def compute_metrics(strategies, noise=0):
    results = run_tournament("tournament", strategies, noise=noise)
    rows = []
    for i in range(len(results.players)):
        row = [
            str(results.players[i]),
            numpy.mean(results.normalised_scores[i]),
            numpy.mean(results.normalised_cooperation[i]),
            results.good_partner_rating[i],
            results.eigenjesus_rating[i],
            results.eigenmoses_rating[i],
        ]
        rows.append(row)
    return rows
def tournament_data(players, turns=200, repetitions=100):
    """
    Run tournaments with repetition and record the following:
        mean score
        mean wins
        wins deviation
        score deviation
    """
    results = run_tournament("--", players, turns=turns, repetitions=repetitions)
    score_data = results.normalised_scores
    win_data = results.wins
    mean_scores = [numpy.mean(s) for s in score_data]
    std_scores = [numpy.std(s) for s in score_data]
    mean_wins = [numpy.mean(w) for w in win_data]
    std_wins = [numpy.std(w) for w in win_data]
    return (mean_scores, std_scores, mean_wins, std_wins)
Ejemplo n.º 4
0
def tournament_data(players, turns=200, repetitions=100):
    """
    Run tournaments with repetition and record the following:
        mean score
        mean wins
        wins deviation
        score deviation
    """
    results = run_tournament("--",
                             players,
                             turns=turns,
                             repetitions=repetitions)
    score_data = results.normalised_scores
    win_data = results.wins
    mean_scores = [numpy.mean(s) for s in score_data]
    std_scores = [numpy.std(s) for s in score_data]
    mean_wins = [numpy.mean(w) for w in win_data]
    std_wins = [numpy.std(w) for w in win_data]
    return (mean_scores, std_scores, mean_wins, std_wins)