Beispiel #1
0
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])
Beispiel #2
0
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])
Beispiel #3
0
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)
Beispiel #4
0
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))