|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.learning.i_ReinforcementLearner_id
Reinforcement learning class with discrete inputs and outputs. The module will learn to select a discrete output based on state and a continuous reinforcement input. The "i"s in front of and behind the name imply that this class takes integers as input and output. The "d" indicates a double for the reinforcement input (i.e. a continuous value). No committment is made to model-free or model-based learning, the class may be extended to either.
Copyright (c)2000 Tucker Balch
Field Summary | |
protected boolean |
logging
Indicates whether logging is turned on or not. |
protected int |
numactions
The number of actions to select from. |
protected int |
numstates
The number of situations or states the object may be in. |
protected java.lang.String |
policyfilename
The name of the file to save or read the policy in/from. |
Constructor Summary | |
i_ReinforcementLearner_id(int numstatesin,
int numactionsin)
Instantiates a reinforcement learner using default parameters. |
Method Summary | |
abstract void |
endTrial(double V,
double reward)
Called when the current trial ends. |
double |
getAvgReward()
return statistical info about the learner. |
int |
getPolicyChanges()
return statistical info about the learner. |
int |
getQueries()
return statistical info about the learner. |
abstract int |
initTrial(int statein)
Called to initialize for a new trial and get the first action. |
void |
log(java.lang.String out)
Print something to the logfile. |
void |
loggingOff()
Turn logging off. |
void |
loggingOn()
Turn logging on, but without opening a file. |
void |
loggingOn(java.lang.String filename)
Turn on logging for data gathering. |
abstract int |
query(int statein,
double rewardin)
Select an output based on the state and reward. |
abstract void |
readPolicy()
Read the policy from a file. |
abstract void |
savePolicy()
Write the policy to a file. |
void |
setPolicyFileName(java.lang.String filename)
Set the filename for policy reading and writing. |
java.lang.String |
toString()
Generate a String that describes the learner. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean logging
protected int numstates
protected int numactions
protected java.lang.String policyfilename
Constructor Detail |
public i_ReinforcementLearner_id(int numstatesin, int numactionsin)
numstates
- int, the number of states the system could be in.numactions
- int, the number of actions or outputs to select from.Method Detail |
public java.lang.String toString()
public abstract int query(int statein, double rewardin)
statein
- int, the current state.rewardin
- double, reward for the last output, positive
numbers are "good."public abstract void endTrial(double V, double reward)
V
- double, the value of the absorbing state. Usually
a large positive number if the final state
is desirable, or negative otherwise.reward
- double, the single-step reward for the last
state/action.public abstract int initTrial(int statein)
statein
- int, the current state.public double getAvgReward()
public int getPolicyChanges()
public int getQueries()
public void setPolicyFileName(java.lang.String filename)
filename
- String, the directory and filename to use.public void loggingOn(java.lang.String filename)
filename
- String, the directory and filename to use.public void log(java.lang.String out)
out
- String, the string to print.public void loggingOff()
public void loggingOn()
public abstract void readPolicy() throws java.io.IOException
filename
- String, the name of the file to read from.public abstract void savePolicy() throws java.io.IOException
filename
- String, the name of the file to write to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |