本文整理汇总了Python中helper.Helper.get_config方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.get_config方法的具体用法?Python Helper.get_config怎么用?Python Helper.get_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.Helper
的用法示例。
在下文中一共展示了Helper.get_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import get_config [as 别名]
def setUp(self):
self.config = Helper.get_config()
self.preprocess = Preprocess(self.config)
self.game = Game(self.config, self.preprocess)
self.kmeans = KMeans(self.config, self.game)
self.pred_nr = self.config.getint('game', 'pred_nr')
self.trap_nr = self.config.getint('game', 'trap_nr')
示例2: setUp
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import get_config [as 别名]
def setUp(self):
self.config = Helper.get_config()
self.preprocess = Preprocess(self.config)
self.game = Game(self.config, self.preprocess)
示例3: GUI
# 需要导入模块: from helper import Helper [as 别名]
# 或者: from helper.Helper import get_config [as 别名]
gui = GUI(game)
game.restart_game()
game_ended = game.game_ended()
while not game_ended:
_, action = sarsa.get_state_and_action()
game.pray.set_direction(action)
game.play_round()
if with_gui:
gui.draw()
game_ended = game.game_ended()
number_of_games -= 1
won_games += (game_ended == Helper.WON)
print 'Won ' + str(won_games) + '/' + str(total_games) + ' total games.'
if __name__ == '__main__':
config = Helper.get_config()
preprocess = Preprocess(config)
game = Game(config, preprocess)
kmeans = KMeans(config, game)
#
# Preprocess module.
#
for i in range(config.getint('algo', 'preprocess_games')):
# Play w/o gui
game.play()
game.restart_game()
print 'Have ' + str(len(preprocess.states)) + ' states after preprocess.'
#
# KMeans module, reduce the number of states.