コード例 #1
0
    def __init__(self, weights):
        game = hlt.Game()
        game.ready("DecisionTreeBot")

        m = model.HaliteModel(weights=weights)
        self.m = m
        self.game = game
コード例 #2
0
    def __init__(self, weights):
        # Get the initial game state
        game = hlt.Game()
        game.ready(os.path.basename(weights))

        # During init phase: initialize the model and compile it
        my_model = model.HaliteModel(weights=weights)

        self.my_model = my_model
        self.game = game
コード例 #3
0
ファイル: SVMBot.py プロジェクト: SpiritusSancti5/Halite-III
    def __init__(self, weights):
        # Get the initial game state
        game = hlt.Game()
        logging.info("Successfully created bot! My Player ID is {}.".format(game.my_id))
        game.ready("SVM-" + os.path.basename(weights))

        # During init phase: initialize the model and compile it
        my_model = model.HaliteModel(weights=weights)

        self.my_model = my_model
        self.game = game
コード例 #4
0
def main():

    bot = model.HaliteModel(weights="out/dt.svc")

    dot_data = tree.export_graphviz(bot.model,
                                    out_file="out/dt.dot",
                                    feature_names=FEATURE_NAMES,
                                    class_names=TARGET_NAMES,
                                    filled=True,
                                    rounded=True,
                                    special_characters=True)
    print(
        "Dot file generated at out/dt.dot. Please run util/render.sh to generate a png file."
    )
コード例 #5
0
ファイル: train.py プロジェクト: karlzhang-hhg/Halite-III
#!/usr/bin/env python3

import model

#m = model.HaliteModel()
#m.train_on_files('replays', 'aggressive')
#m.save(file_name='aggressive.svc')

m = model.HaliteModel()
m.train_on_files('replays', 'aggressive')
m.save(file_name='aggressive.svc')

m = model.HaliteModel()
m.train_on_files('replays', 'passive')
m.save(file_name='passive.svc')
コード例 #6
0
def main():
    m = model.HaliteModel()
    m.train_on_folder("./training")
    m.save(file_name="out/dt.svc")
    print("Training complete. SVC file at out/dt.svc")
    print("call ./run_game.sh to test bot")