edu.iastate.jrelm.rl
Class AbstractStatelessPolicy<I,A extends Action>

java.lang.Object
  extended by edu.iastate.jrelm.rl.AbstractStatelessPolicy<I,A>
All Implemented Interfaces:
Policy<I,A,java.lang.Object,State>, StatelessPolicy<I,A>
Direct Known Subclasses:
SimpleStatelessPolicy

public abstract class AbstractStatelessPolicy<I,A extends Action>
extends java.lang.Object
implements StatelessPolicy<I,A>

An abstract implementation of the StatelessPolicy interface. The StatelessPolicy is a specialization of the general Policy that doesn't make use of States. This means, as an interface, StatelessPolicy inherits extra State related methods from Policy that will never be used. This abstract class is provided as a convenience to define away the extra methods for those who want to implement a StatelessPolicy.

Author:
Charles Gieseler

Constructor Summary
AbstractStatelessPolicy()
           
 
Method Summary
 A generateAction(java.lang.Object stateID)
          Given the current State as indicated by the stateID, choose a new Action according to the current policy.
 double getProbability(java.lang.Object stateID, I actionID)
          Gets the current probability of choosing a particular action from the current state.
 StateDomain<java.lang.Object,State> getStateDomain()
          Defined away since this type of policy does not work with States.
 void setProbability(java.lang.Object stateID, I actionID, double newValue)
          Updates the probability of choosing an Action from the given State.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.iastate.jrelm.rl.StatelessPolicy
generateAction, getActionDomain, getLastAction, getProbability, setProbability
 
Methods inherited from interface edu.iastate.jrelm.rl.Policy
setRandomSeed
 

Constructor Detail

AbstractStatelessPolicy

public AbstractStatelessPolicy()
Method Detail

generateAction

public A generateAction(java.lang.Object stateID)
Description copied from interface: Policy
Given the current State as indicated by the stateID, choose a new Action according to the current policy.

Specified by:
generateAction in interface Policy<I,A extends Action,java.lang.Object,State>
Returns:
an Action selected according to the policy.

getStateDomain

public StateDomain<java.lang.Object,State> getStateDomain()
Defined away since this type of policy does not work with States. This method will return null.

Specified by:
getStateDomain in interface Policy<I,A extends Action,java.lang.Object,State>
Returns:

getProbability

public double getProbability(java.lang.Object stateID,
                             I actionID)
Description copied from interface: Policy
Gets the current probability of choosing a particular action from the current state.

Specified by:
getProbability in interface Policy<I,A extends Action,java.lang.Object,State>
Parameters:
stateID - - the identifier of the desired State in the StateDomain
actionID - - the identifier of the desired Action in the ActionDomain
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

public void setProbability(java.lang.Object stateID,
                           I actionID,
                           double newValue)
Description copied from interface: Policy
Updates the probability of choosing an Action from the given State.

Specified by:
setProbability in interface Policy<I,A extends Action,java.lang.Object,State>
Parameters:
stateID - - the identifier of the desired State in this policy's StateDomain.
actionID - - the identifier of the desired Action in this policy's ActionDomain.
newValue - - new choice probability value to associate with this action-state pair.