def applyEpisodeFinished(self, episodeFinished): """ apply transformations to episodeFinished and return it. """ DecayExplorer.applyEpisodeFinished(self, episodeFinished) # at end of episode, randomize the exploration parameters if episodeFinished: self.randomizeMapping() return episodeFinished
def applyEpisodeFinished(self, episodeFinished): """ apply transformations to episodeFinished and return it. """ episodeFinished = DecayExplorer.applyEpisodeFinished(self, episodeFinished) if episodeFinished: if self.oldTable != None: self.experiment.agent.estimator.values[:] = self.oldTable self.oldTable = None return episodeFinished
def __init__(self, epsilon, episodeCount=None, actionCount=None): """ set the probability epsilon, with which a random action is chosen. """ DecayExplorer.__init__(self, epsilon, episodeCount, actionCount)
def __init__(self, epsilon, episodeCount=None, actionCount=None): DecayExplorer.__init__(self, epsilon, episodeCount, actionCount) # active is now property, this is the helper variable self.active_ = True self.oldTable = None
def applyState(self, state): """ save current state for _explore() method later on. """ DecayExplorer.applyState(self, state) self.state = state return state
def setExperiment(self, experiment): DecayExplorer.setExperiment(self, experiment) # create random exploration mapping self.explMapping = Linear(self.experiment.conditions['stateDim'], self.experiment.conditions['actionNum']) self.randomizeMapping()