edu.iastate.jrelm.rl
Interface Policy<AI,A extends Action,SI,S extends State>

All Known Subinterfaces:
StatelessPolicy<I,A>
All Known Implementing Classes:
AbstractStatelessPolicy, REPolicy, SimplePolicy, SimpleStatelessPolicy

public interface Policy<AI,A extends Action,SI,S extends State>

Interface for building a reinforcement learning policy which is typically a mapping from States to Actions. The policy essentially represents learned knowledge and is the basis for choosing new actions. A ReinforcementLearner updates the policy as dictated by the specific learning algorithm that it implements and queriess the policy for a choice of the next action. Since a policy maps between States and Actions and may assign values to States, Actions, or State-Action pairs, it should operate over a given ActionDomain and StateDomain.

Author:
Charles Gieseler

Method Summary
 A generateAction(SI stateID)
          Given the current State as indicated by the stateID, choose a new Action according to the current policy.
 ActionDomain<AI,A> getActionDomain()
          Get the ActionDomain that this policy selects Actions from.
 A getLastAction()
          Retrieve the last Action chosen by this policy.
 double getProbability(SI stateID, AI actionID)
          Gets the current probability of choosing a particular action from the current state.
 StateDomain<SI,S> getStateDomain()
          Get the StateDomain this policy is using
 void setProbability(SI stateID, AI actionID, double newValue)
          Updates the probability of choosing an Action from the given State.
 void setRandomSeed(int seed)
          Should reset the psuedo-random number generator used by this Policy when generating new Action selections.
 

Method Detail

generateAction

A generateAction(SI stateID)
Given the current State as indicated by the stateID, choose a new Action according to the current policy.

Returns:
an Action selected according to the policy.

getActionDomain

ActionDomain<AI,A> getActionDomain()
Get the ActionDomain that this policy selects Actions from.

Returns:
the associated ActionDomain

getStateDomain

StateDomain<SI,S> getStateDomain()
Get the StateDomain this policy is using

Returns:

getLastAction

A getLastAction()
Retrieve the last Action chosen by this policy.


getProbability

double getProbability(SI stateID,
                      AI actionID)
Gets the current probability of choosing a particular action from the current state.

Parameters:
actionID - - the identifier of the desired Action in the ActionDomain
stateID - - the identifier of the desired State in the StateDomain
Returns:
the probability of choosing the specified Action from the given State. Should return Double.NaN if actionID or stateID are do not point to elements in the respective domains.

setProbability

void setProbability(SI stateID,
                    AI actionID,
                    double newValue)
Updates the probability of choosing an Action from the given State.

Parameters:
actionID - - the identifier of the desired Action in this policy's ActionDomain.
stateID - - the identifier of the desired State in this policy's StateDomain.
newValue - - new choice probability value to associate with this action-state pair.

setRandomSeed

void setRandomSeed(int seed)
Should reset the psuedo-random number generator used by this Policy when generating new Action selections.

Parameters:
seed -