run.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:dotabots-ml-tools 作者: ThePianoDentist 项目源码 文件源码
def go(self):
        run_counter = 0
        #lets you get mouse over dota
        while run_counter < self.max_runs:
            run_counter += 1
            self.run = Run(self.db.get_num_results() + 1)
            print("Hi")
            time.sleep(2.5)
            self.run.start_game()
            self.run.set_logs()  # Shouldnt matter that this occurs after game launch. I only care about logs around pull
            self.run.follow_bot()
            self.run.wait_for_pull() # ASYNCIO time?
            self.run.dump_console()
            self.run.restart()
            self.run.delay(pa.click, 282, 748, delay_secs=3)  # click the skip button
            # At this point the bot script sends the new result to database
            new_result = self.run.read_log()
            self.db.add_run(self.run.id, new_result)
            time.sleep(0.01)  # this is only because I expected game to send result to elastic search. not python
            result = Result(self.db.get_run(self.run.id))
            self.neural_net.add_result(result)
            self.neural_net.iterate_weights_2(100)
            # print(self.neural_net.weights)
            logger.info(self.neural_net)
            self.neural_net.update_params()
            #self.run.read_log()  # TODO this bit can be async whilst we are starting the next game
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号