本文整理汇总了Python中pybrain.rl.agents.LearningAgent.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python LearningAgent.__init__方法的具体用法?Python LearningAgent.__init__怎么用?Python LearningAgent.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pybrain.rl.agents.LearningAgent
的用法示例。
在下文中一共展示了LearningAgent.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pybrain.rl.agents import LearningAgent [as 别名]
# 或者: from pybrain.rl.agents.LearningAgent import __init__ [as 别名]
def __init__(self, name, num_states, num_actions, epsilon=0.3, gamma=0.99, alpha=0.95):
self.controller = ActionValueTable(num_states, num_actions)
self.controller.initialize(np.random.rand(num_states * num_actions))
self.learner = Q(gamma=gamma, alpha=alpha)
self.learner.batchMode = False
self.learner.explorer.epsilon = epsilon
LearningAgent.__init__(self, self.controller, self.learner)
Agent.__init__(self, name)
示例2: __init__
# 需要导入模块: from pybrain.rl.agents import LearningAgent [as 别名]
# 或者: from pybrain.rl.agents.LearningAgent import __init__ [as 别名]
def __init__(self, _id, module, learner=None):
#define variaveis da class
self.id = _id
self.horizontal_edge = lane.getEdgeID(trafficlights.getControlledLanes(self.id)[0])
self.vertical_edge = lane.getEdgeID(trafficlights.getControlledLanes(str(_id))[2])
#define variaveis da classe pai
self.horizontalLoad = []
self.verticalLoad = []
self.averageHorizontal = []
self.averageVertical = []
self.nextAction = None
self.expectedReward = None
self.tolerance = None
LearningAgent.__init__(self, module, learner)
示例3: __init__
# 需要导入模块: from pybrain.rl.agents import LearningAgent [as 别名]
# 或者: from pybrain.rl.agents.LearningAgent import __init__ [as 别名]
def __init__(self, module, learner = None):
'''
Constructor
'''
LearningAgent.__init__(self, module, learner)
self.__rules=[]
self.__states={}
self.__input={}
self.__buffer={}
# self.__rules.append(BackOffRule())
self.__rules.append(BackOffRule2())
self.__rules.append(LocomotionPrimitives())
self.__states["driveBackStartTime"]=AgentMind.__driveBackStartTime
self.__states["__lostTrackTurnStartTime"]=AgentMind.__lostTrackTurnStartTime
示例4: __init__
# 需要导入模块: from pybrain.rl.agents import LearningAgent [as 别名]
# 或者: from pybrain.rl.agents.LearningAgent import __init__ [as 别名]
def __init__(self, x, y, brain, learner, env):
LearningAgent.__init__(self, brain.net, learner)
self.cellType = 3
self.brain = brain
self.module = brain.net
self.learner = learner
self.env = env
self.color = cell.BLACK
self.x = x
self.y = y
self.num_interactions = 0
self.age = 0
self.colddown = 0
self.speed = self.Speeds[0]
self.energy = self.MaxEnergy
self.food_sensor = 0;
self.hunger_sensor = 0;
self.target = [-1, -1]