def app(): treeia = TreeIA(gen_feature_simple) treeia.learn(fn="best_goal") treeia.save("best_goal.pkl") treeia.to_dot("best_goal.dot")
from soccersimulator import SoccerBattle, SoccerPlayer, SoccerTeam from soccersimulator import PygletObserver, ConsoleListener, LogListener from soccersimulator import TreeIA, TreeStrategy from soccersimulator import pyglet from stratatt import * from stratdef import * from stratmix import * from apprentissage import * treeia = TreeIA( gen_feature_simple, dict({ "DefenseurBis": DefenseurBis(), "CoinHaut": CoinHaut(), "CoinBas": CoinBas(), "Haut": Haut(), "Bas": Bas() })) fn = os.path.join(os.path.dirname(os.path.realpath(__file__)), "defenseurcoin1.pkl") treeia.load(fn) TreeST = TreeStrategy("tree1", treeia) team1 = SoccerTeam("Poireaux") team1.add_player(SoccerPlayer("t1j1", DegageTer())) team4 = SoccerTeam("Carottes") team4.add_player(SoccerPlayer("t4j2", MixSimple())) team2 = SoccerTeam("Patates") team2.add_player(SoccerPlayer("t2j1", Degage()))
def app(): treeia = TreeIA(gen_feature_simple) treeia.learn(fn="test_interact.pkl") treeia.save("myfirsttree.pkl")
def app(): treeia = TreeIA(gen_feature_simple) treeia.learn(fn="Defenseur1", depth=10) treeia.save("Defenseur1.pkl") treeia.to_dot("Defenseur1.dot")
from outils import * from apprentissage import * team3=SoccerTeam("team1") team5=SoccerTeam("team2") #team5.add_player(SoccerPlayer("FS",comp)) #team5.add_player(SoccerPlayer("DT",comp)) #team5.add_player(SoccerPlayer("DC",DefenseurBis())) #team5.add_player(SoccerPlayer("MS",Attaquant())) ############################################################################### # apprentissage team_tree = SoccerTeam("Team Tree") treeia=TreeIA(gen_feature_simple,dict({"DefenseurBis":DefenseurBis(),"CoinHaut":CoinHaut(),"CoinBas":CoinBas(),"Haut":Haut(),"Bas":Bas()})) fn=os.path.join(os.path.dirname(os.path.realpath(__file__)),"defenseurcoin2.pkl") treeia.load(fn) TreeST=TreeStrategy("tree1",treeia) treeia1=TreeIA(gen_feature_simple,dict({"DefBis":DefenseurBis(),"Haut":Haut(),"Bas":Bas()})) fn=os.path.join(os.path.dirname(os.path.realpath(__file__)),"def_plusproche.pkl") treeia1.load(fn) TreeST1=TreeStrategy("tree2",treeia1) treeia2=TreeIA(gen_feature_simple,dict({"DefBis":DefenseurBis(),"Degage":Degage(),"TirerCoinHaut":TirerCoinHaut(),"TirerCoinBas":TirerCoinBas(),"Haut":Haut(),"Bas":Bas()})) fn=os.path.join(os.path.dirname(os.path.realpath(__file__)),"att2.pkl") treeia2.load(fn) TreeST2=TreeStrategy("tree3",treeia2)
def app(): treeia = TreeIA(gen_feature_simple) treeia.learn(fn="Att2") treeia.save("att2.pkl") treeia.to_dot("att2.dot")
def Apprentissage(): treeia=TreeIA(gen_feature_simple) treeia.learn(fn="botatk1.pkl") treeia.save("arbrebotatk1.pkl") treeia.to_dot("arbrebotdatk1.dot") treeia=TreeIA(gen_feature_simple) treeia.learn(fn="botdef1.pkl") treeia.save("arbrebotdef1.pkl") treeia.to_dot("arbrebotdef1.dot") print "end" """ dot -Tpdf nom -o nom.pdf""" #Apprentissage()
def app(): treeia=TreeIA(gen_feature_simple) treeia.learn(fn="test_interact.pkl") treeia.save("myfirsttree.pkl")