|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.reinforcement.qlearning.QTable
public class QTable
Q-table implementation
| Constructor Summary | |
|---|---|
QTable()
Creates a q-table with default parameters |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the content of q-table |
java.lang.Object |
getBestAction(java.lang.Object state)
Returns best action for given state |
java.util.Collection |
getBestActions()
Returns all of the best actions for each states tried so far |
double |
getBestValue(java.lang.Object state)
Returns the best reinforcement value for given state |
int |
getNumberOfStates()
Returns the number of different states in the q-table |
int |
getSize()
Returns the number of entries in q-table |
java.util.Enumeration |
getStates()
Returns different states in the q-table. |
double |
getValue(java.lang.Object state,
java.lang.Object action)
Returns reinforcement value for given state and action |
boolean |
hasState(java.lang.Object state)
Chacks whether the q-table contains the given state |
boolean |
hasStateActionPair(java.lang.Object state,
java.lang.Object action)
Chacks whether the q-table contains the given state-action pair |
void |
updateValue(java.lang.Object state,
java.lang.Object action,
double value)
Updates q-table with given state, action and value information |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QTable()
| Method Detail |
|---|
public void updateValue(java.lang.Object state,
java.lang.Object action,
double value)
state - state before the action is doneaction - action performed for given rewardvalue - reinforcement taken after the action is done
public java.lang.Object getBestAction(java.lang.Object state)
throws QTableEntryNotFoundException
state - state to look for best action
QTableEntryNotFoundException - if the given state is not found in
q-table
public double getValue(java.lang.Object state,
java.lang.Object action)
throws QTableEntryNotFoundException
state - state to look for reinforcement valueaction - action to look for reinforcement value
QTableEntryNotFoundException - if the given state-action pair can
not be found in q-table
public double getBestValue(java.lang.Object state)
throws QTableEntryNotFoundException
state - state to look for the best reinforcement value
QTableEntryNotFoundException - if the given state is not found in
the q-tablepublic boolean hasState(java.lang.Object state)
state - state to search in the q-table
public boolean hasStateActionPair(java.lang.Object state,
java.lang.Object action)
state - state to search in the q-tableaction - action to search in the q-table
public int getNumberOfStates()
public java.util.Enumeration getStates()
public java.util.Collection getBestActions()
public int getSize()
public void clear()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||