コード例 #1
0
ファイル: test.py プロジェクト: amidos2006/Worst-First-Search
def playAllAgainst(filename, agent, parameter):
    agentName = type(agent).__name__
    result = playGame([Agents.NormalMCTS(), agent]).split("-")
    writeFile(
        filename, "NormalMCTS" + ", " + agentName + ", " + str(parameter) +
        ", " + result[0] + ", " + result[1])
    result = playGame([agent, Agents.NormalMCTS()]).split("-")
    writeFile(
        filename, agentName + ", " + "NormalMCTS" + ", " + str(parameter) +
        ", " + result[0] + ", " + result[1])
コード例 #2
0
ファイル: test.py プロジェクト: amidos2006/Worst-First-Search
def playAllAgainst(filename, agent, parameter, seed):
    agentName = agent.__class__.__name__
    Agents.fixSeed(seed)
    result = playGame([Agents.NormalMCTS(), agent]).split("-")
    writeFile(
        filename, "NormalMCTS" + ", " + agentName + ", " + str(parameter) +
        ", " + result[0] + ", " + result[1])
    Agents.fixSeed(seed)
    result = playGame([agent, Agents.NormalMCTS()]).split("-")
    writeFile(
        filename, agentName + ", " + "NormalMCTS" + ", " + str(parameter) +
        ", " + result[0] + ", " + result[1])
コード例 #3
0
ファイル: test.py プロジェクト: amidos2006/Worst-First-Search
def singleEffect(filename, parameter):
    seed = rnd.randint(0, Global.BIG_NUM)
    playAllAgainst(filename, Agents.DepMCTS(), str(parameter), seed)
    playAllAgainst(filename, Agents.DepUnDepMCTS(0.5), str(parameter), seed)
    playAllAgainst(filename, Agents.SimulatedMCTS(0.97), str(parameter), seed)
    playAllAgainst(filename, Agents.FlippingMCTS(), str(parameter), seed)
    playAllAgainst(filename, Agents.NormalMCTS(), str(parameter), seed)
コード例 #4
0
ファイル: test.py プロジェクト: amidos2006/Worst-First-Search
def singleEffect(filename, parameter):
    playAllAgainst(filename, Agents.DepMCTS(), str(parameter))
    playAllAgainst(filename, Agents.DepUnDepMCTS(0.5), str(parameter))
    playAllAgainst(filename, Agents.SimulatedMCTS(0.97), str(parameter))
    playAllAgainst(filename, Agents.FlippingMCTS(), str(parameter))
    playAllAgainst(filename, Agents.NormalMCTS(), str(parameter))