net.pakl.rl
Class ReinforcementFunction

java.lang.Object
  extended by net.pakl.rl.ReinforcementFunction
Direct Known Subclasses:
ReadingReinforcementFunction

public class ReinforcementFunction
extends java.lang.Object

This class contains all of the required functionality for a reward function and should be applicable to all worlds. But, it must be initialized by something that knows what the appropriate reinforcement is for the world such as by a function in a Toolbox.


Constructor Summary
ReinforcementFunction()
           
 
Method Summary
 double getDefaultReinforcement()
           
 double getReward(State state, Action action)
          Return the reward given an action from a particular state.
 double getReward(State state, Action action, State newState)
          Sometimes a reward is also based on the resulting state.
 void setDefaultReinforcement(double newDefault)
          This function allows you to set the default reinforcement for any action from a state where reinforcement has not been specified.
 void setReward(State state, Action action, double newReward)
           
 java.lang.String toText()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReinforcementFunction

public ReinforcementFunction()
Method Detail

setDefaultReinforcement

public void setDefaultReinforcement(double newDefault)
This function allows you to set the default reinforcement for any action from a state where reinforcement has not been specified. For example, if you have a pond with sparse landing surfaces, it may be easier to use this function to set the value of the water than to specify the reinforcement value for each possible action leading to water.


getDefaultReinforcement

public double getDefaultReinforcement()

toText

public java.lang.String toText()

getReward

public double getReward(State state,
                        Action action)
Return the reward given an action from a particular state.


getReward

public double getReward(State state,
                        Action action,
                        State newState)
Sometimes a reward is also based on the resulting state. Rather than re-computing the resulting state of the action (and if the results of actions are stochastic rather than deterministic, that could be the wrong thing to do), this function lets you pass in the state that actually resulted.


setReward

public void setReward(State state,
                      Action action,
                      double newReward)