当前位置: 首页>>代码示例>>Python>>正文


Python KeyboardStrategy.write方法代码示例

本文整理汇总了Python中soccersimulator.KeyboardStrategy.write方法的典型用法代码示例。如果您正苦于以下问题:Python KeyboardStrategy.write方法的具体用法?Python KeyboardStrategy.write怎么用?Python KeyboardStrategy.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在soccersimulator.KeyboardStrategy的用法示例。


在下文中一共展示了KeyboardStrategy.write方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
""" Permet de jouer et d'entrainer une strategie
    * changer les strategies ajoutees
    * utilisation : python entrainer prefix_fichier_exemple
    par defaut ajoute au fichier d'exemples sil existe deja
    (extension : .exp pour le fichier exemple)
"""

from soccersimulator import SoccerMatch, show, SoccerTeam,Player,KeyboardStrategy
from WalterIA import *
import sys
if __name__=="__main__":
    prefix = "tree"
    if len(sys.argv)>1:
        prefix = sys.argv[1]
    strat_key = KeyboardStrategy()
    strat_key.add("e",all2(3))
    strat_key.add("a",gogole())
    strat_key.add("z",all2(2))
    team_noob = SoccerTeam("keyb",[Player("KBs", strat_key)])
    team_bad = SoccerTeam("foncteam",[Player("Fonceur",all2(3))])
    match = SoccerMatch(team_noob,team_bad,2000)
    show(match)
    strat_key.write(prefix+".exp",True)
开发者ID:luluperet,项目名称:2I013,代码行数:25,代码来源:entrainer.py

示例2: KeyboardStrategy

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
from strategy import MaStrategyUtilitaire
import soccersimulator
from tools import PlayerStateDeco
from soccersimulator import KeyboardStrategy

strat = KeyboardStrategy()
strat.add("a",MaStrategyFonceur())
strat.add("z",MaStrategyDefensive())
strat.add("e",MaStrategyUtilitaire())
strat.add("r",MaStrategyGoal())

joueur1 = Player("Alpha", strat)
joueur2 = Player("Dourou", MaStrategyCampeur())
joueur3=  Player("Kiba", MaStrategyGoal())
joueur4=  Player("Soro", MaStrategyFonceur())
joueur5 = Player("Dadan", MaStrategyDefensive())
joueur6 = Player("Manque d'inspi", MaStrategyUtilitaire())

team1 = SoccerTeam("Equipe 1", [joueur1,joueur3])
team2 = SoccerTeam("Equipe 2", [joueur5,joueur3])
team3 = SoccerTeam("Equipe 3", [joueur1,joueur2,joueur3,joueur5]) 
team4 = SoccerTeam("Equipe 4", [joueur6,joueur2,joueur3,joueur5])


match = SoccerMatch(team3, team4)
soccersimulator.show(match)
strat.write("test4v4_7.exp")



开发者ID:Asparodia,项目名称:soccersimulator,代码行数:29,代码来源:test.py

示例3: len

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
# -*- coding: utf-8 -*-
from soccersimulator import SoccerMatch, show, SoccerTeam, Player, KeyboardStrategy
from strategies import *
import sys


if __name__ == "__main__":
    prefix = "test"
    if len(sys.argv) > 1:
        prefix = sys.argv[1]
    strat_g = KeyboardStrategy()
    strat_g.add("t", MarquerStrategy())
    strat_g.add("y", DribleStrategy())
    strat_g.add("z", PasseStrategy())

    team45 = SoccerTeam(
        "team4", [Player("Al", strat_g), Player("xxx", strat_g), Player("Samounette", strat_g), Player("Sam", strat_g)]
    )
    team46 = SoccerTeam(
        "team4",
        [
            Player("S", Defenseur1Strategy()),
            Player("am", Defenseur2Strategy()),
            Player("l", GoalStrategy()),
            Player("As", DribleStrategy()),
        ],
    )
    match = SoccerMatch(team45, team46, 10000)
    show(match)
    strat_g.write(prefix + ".exp", True)
开发者ID:fifa2016,项目名称:projet_foot,代码行数:32,代码来源:entrainer.py

示例4: KeyboardStrategy

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
        prefix = sys.argv[1]    
    keytest = KeyboardStrategy(fn = "goal")
   # keytest.add("d",defenseG)
   # keytest.add("a",attaqueG)
    keytest.add("z",millieu)
    keytest.add("f",finition)
    keytest.add("t",tirer)
    keytest.add("c",conserver)
    keytest.add("g",dribbler)
    #keytest.add("q",passer)
    #keytest.add("x",position)   
#    keytest.add("c",central)

############## pour le gardien #########"""


    keytest.add("g",posG)
    keytest.add("d",posGH)
    keytest.add("c",posGB)   
    keytest.add("x",degG)
    
   
    team_noob = SoccerTeam("keyb",[Player("KBs",millieu),Player("Defense",defenseG),Player("taaaaaa",attaqueG),Player("Dg",goalG)])
    teama4 = SoccerTeam("test",[Player("t",defenseG),Player("Defense",keytest)])
    teamPSG4 = SoccerTeam("team1",[Player("trapp",attaqueG),Player("silva",defenseG)])
#    ,Player("aurier",defenseG),Player("zlatan",attaqueG)])

    match = SoccerMatch(teama4,team_noob,3000)
    show(match)
    keytest.write("goal.exp",True)
开发者ID:redxrdx,项目名称:2iO13,代码行数:32,代码来源:entrainer.py

示例5: KeyboardStrategy

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
from strategy import MaStrategyGoal
from strategy import MaStrategyUtilitaire

from tools import PlayerStateDeco
from soccersimulator import KeyboardStrategy

strat = KeyboardStrategy()
strat.add("a",MaStrategyFonceur())
strat.add("z",MaStrategyDefensive())
strat.add("e",MaStrategyCampeur())
strat.add("r",MaStrategyUtilitaire())

joueur1 = Player("Alpha", strat)
joueur2 = Player("Dourou", MaStrategyCampeur())
joueur3=  Player("Kiba", MaStrategyGoal())
joueur4=  Player("Soro", MaStrategyFonceur())
joueur5 = Player("Dadan", MaStrategyDefensive())
joueur6 = Player("Manque d'inspi", MaStrategyUtilitaire())

team1 = SoccerTeam("Equipe 1", [joueur1,joueur3])
team2 = SoccerTeam("Equipe 2", [joueur4,joueur5])
team4 = SoccerTeam("Equipe 4", [joueur6,joueur2,joueur3,joueur5])


match = SoccerMatch(team1, team4)
soccersimulator.show(match)
strat.write("testexp")



开发者ID:ad50144124,项目名称:mon_projet,代码行数:29,代码来源:test.py

示例6: KeyboardStrategy

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
from soccersimulator import SoccerMatch, show, SoccerTeam,Player,KeyboardStrategy,KeyboardStrategy
from strategy import MaStrategyFonceur
from strategy import MaStrategyDefensive
from strategy import MaStrategyCampeur
from strategy import MaStrategyUtilitaire
from strategy import MaStrategyGoal


strat = KeyboardStrategy()
strat.add("a",MaStrategyFonceur())
strat.add("z",MaStrategyDefensive())
strat.add("e",MaStrategyUtilitaire())
strat.add("r",MaStrategyGoal())

joueur1 = Player("Alpha", strat)
joueur2 = Player("Dourou", MaStrategyCampeur())
joueur3=  Player("Kiba", MaStrategyGoal())
joueur4=  Player("Soro", MaStrategyFonceur())
joueur5 = Player("Dadan", MaStrategyDefensive())
joueur6 = Player("Manque d'inspi", MaStrategyUtilitaire())

team1 = SoccerTeam("Equipe 1", [joueur1,joueur4])
team2 = SoccerTeam("Equipe 2", [joueur4,joueur5])

	
	
match = SoccerMatch(team1,team2,2000)
show(match)
strat.write("training.exp",True)
开发者ID:Asparodia,项目名称:soccersimulator,代码行数:31,代码来源:training.py

示例7: len

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
if __name__=="__main__":
    prefix = "tree"
    if len(sys.argv)>1:
        prefix = sys.argv[1]    
    keytest = KeyboardStrategy(fn = "mon_fichier")
    keytest.add("d",defenseG)
   # keytest.add("a",attaqueG)
    keytest.add("z",millieu)
    keytest.add("f",finition)
    keytest.add("t",tirer)
    keytest.add("c",conserver)
    keytest.add("g",dribbler)
    keytest.add("q",passer)
    keytest.add("x",position)   
#    keytest.add("c",central)
#    keytest.add("g",posG)
#    keytest.add("d",posGH)
#    keytest.add("c",posGB)   
#    keytest.add("x",degG)
    
   
    team_noob = SoccerTeam("keyb",[Player("KBs",millieu),Player("Defense",defenseG),Player("taaaaaa",attaqueG),Player("Dg",goalG)])
    teama4 = SoccerTeam("test",[Player("t",defenseG),Player("Defense",keytest)])
    teamPSG4 = SoccerTeam("team1",[Player("trapp",attaqueG),Player("silva",defenseG)])
#    ,Player("aurier",defenseG),Player("zlatan",attaqueG)])

    match = SoccerMatch(teama4,teamPSG4,3000)
    show(match)
    keytest.write("mon_fichier.exp",True)
开发者ID:redxrdx,项目名称:TMESOLO,代码行数:31,代码来源:entrainer.py

示例8: KeyboardStrategy

# 需要导入模块: from soccersimulator import KeyboardStrategy [as 别名]
# 或者: from soccersimulator.KeyboardStrategy import write [as 别名]
#team2=SoccerTeam("team1",[Player("t1j1",StateLessStrategy(Smart1v1)),Player("t1j2",StateLessStrategy(Smart1v1)),Player("t1j3",StateLessStrategy(Smart1v1)),Player("t1j4",StateLessStrategy(Smart1v1))])


strat = KeyboardStrategy() #ou pour une sauvegarde automatique
#KeyboardStrategy(fn="monfichier.exp")
FS = StateLessStrategy(fonceur)
GK = StateLessStrategy(QuickFollow)

strat.add("d",FS)
strat.add("a",GK)
player1 = Player("j1",strat)

team1=SoccerTeam("team1",[player1])
team2=SoccerTeam("team2",[Player("t2j1",StateLessStrategy(Smart1v1))])
match=SoccerMatch(team1,team2)

show(match)
strat.write("monfichier.exp")



#match=SoccerMatch(team1,team2)
#soccersimulator.show(match)

#tournoi = SoccerTournament(1)
#tournoi.add_team(team1)
#tournoi.add_team(team2)

#tournoi.play()
#soccersimulator.show(tournoi)
开发者ID:ad50144124,项目名称:mon_projet,代码行数:32,代码来源:project.py


注:本文中的soccersimulator.KeyboardStrategy.write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。