Esempio n. 1
0
from soccersimulator import ChallengeFonceurButeur, SoccerTeam, show_simu
from ia.strategies import FonceurChallenge1Strategy

team = SoccerTeam("ChPerFusion")
team.add("FonceurCh1Joueur", FonceurChallenge1Strategy())

challenge = ChallengeFonceurButeur(team, max_but=20)
show_simu(challenge)
print("temps moyen : ", challenge.stats_score, "\nliste des temps",
      challenge.resultats)
Esempio n. 2
0
# -*- coding: utf-8 -*-
from soccersimulator import ChallengeFonceurButeur, SoccerTeam, show_simu
from module import *

import numpy as np
import matplotlib.pyplot as plt

acc = np.arange(0.5, 1.0, 0.01)
time = np.empty_like(acc)

for i in range(acc.size):
    print("acc =", acc[i])

    team = SoccerTeam("Equipe")
    team.add("Joueur", ShootBallStrategy(acc[i]))

    challenge = ChallengeFonceurButeur(team,
                                       max_but=10,
                                       max_steps=float("inf"))
    challenge.start()
    #print("temps moyen : ",challenge.stats_score, "\nliste des temps",challenge.resultats)
    time[i] = challenge.stats_score

plt.plot(acc, time)
plt.xlabel('acceleration')
plt.ylabel("temps")
plt.grid(True)