Beispiel #1
0
    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
Beispiel #2
0
    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
Beispiel #3
0
 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)
Beispiel #4
0
    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
Beispiel #5
0
    def applyState(self, state):
        """ save current state for _explore() method later on. """
        DecayExplorer.applyState(self, state)

        self.state = state
        return state
Beispiel #6
0
    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()