Beispiel #1
0
 def getSensors(self):
     """ the currently visible state of the world (the observation may be 
         stochastic - repeated calls returning different values)
         
         :rtype: by default, this is assumed to be a numpy array of doubles
         :note: This function is abstract and has to be implemented.
     """
     abstractMethod()
 def performAction(self, action):
     """ perform an action on the world that changes it's internal state (maybe stochastically)
     
         :key action: an action that should be executed in the Environment, by an agent. 
         :type action: tuple: (agentID, action value)
         :note: This function is abstract and has to be implemented.
     """
     abstractMethod()
Beispiel #3
0
 def performAction(self, action):
     """ perform an action on the world that changes it's internal state (maybe 
         stochastically).
         :key action: an action that should be executed in the Environment. 
         :type action: by default, this is assumed to be a numpy array of doubles
         :note: This function is abstract and has to be implemented.
     """
     abstractMethod()
Beispiel #4
0
 def _learnStep(self):
     """ The core method to be implemented by all subclasses. """
     abstractMethod()        
Beispiel #5
0
 def getMaxAction(self, state):
     abstractMethod()
Beispiel #6
0
 def isFinished(self):
     """ Is the current episode over? """
     abstractMethod()
Beispiel #7
0
 def updater(self, pos, neg, poshb, neghb, posvb, negvb):
     abstractMethod()
Beispiel #8
0
 def _forwardImplementation(self, inbuf, outbuf):
     """Actual forward transformation function. To be overwritten in 
     subclasses."""
     abstractMethod()
Beispiel #9
0
 def learn(self):
     """ The main method, that invokes a learning step. """
     abstractMethod()
Beispiel #10
0
 def f(self, x):
     """ The function itself, to be defined by subclasses """
     abstractMethod()
Beispiel #11
0
 def _render(self): 
     """ Here, the render methods are called. This function has to be implemented by subclasses. """
     abstractMethod() 
Beispiel #12
0
 def updateData(self):
     """ overwrite this class to update whatever data the renderer needs to display the current
         state of the world. """
     abstractMethod()
Beispiel #13
0
 def mutate(self, **args):
     """ Vary some properties of the underlying module, so that it's behavior 
     changes, (but not too abruptly). """
     abstractMethod()
Beispiel #14
0
 def randomize(self):
     """ Sets all variable parameters to random values. """
     abstractMethod()
Beispiel #15
0
 def getActionValues(self, state):
     abstractMethod()
Beispiel #16
0
 def topologyMutate(self):
     abstractMethod()
Beispiel #17
0
 def train(self):
     """Train on the current dataset, for a single epoch."""
     abstractMethod()
Beispiel #18
0
 def _forwardImplementation(self, inbuf, outbuf):
     abstractMethod()
Beispiel #19
0
 def doMove(self, player, action):
     """ the core method to be implemented bu all TwoPlayerGames: 
     what happens when a player performs an action. """
     abstractMethod()
Beispiel #20
0
 def _backwardImplementation(self, outerr, inerr, inbuf):
     abstractMethod()
Beispiel #21
0
 def sampler(self, probabilities):
     abstractMethod()
Beispiel #22
0
 def initPopulation(self):
     """ initialize the population """
     abstractMethod()
Beispiel #23
0
 def getAction(self):
     """ Return a chosen action.
         :rtype: by default, this is assumed to ba a numpy array of doubles.
         :note: This method is abstract and needs to be implemented.
     """
     abstractMethod()
Beispiel #24
0
 def produceOffspring(self):
     """ generate the new generation of offspring, given the current population, and their fitnesses """
     abstractMethod()
Beispiel #25
0
 def getReward(self):
     """ Compute and return the current reward (i.e. corresponding to the last action performed) """
     return abstractMethod()
 def calculateGradient(self):
     abstractMethod()