|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabp.AdaptiveProcess
public final class AdaptiveProcess
An adaptive process is a group of adaptives that work in tandem towards some common goal. Each adaptive might represent a specific choice we have to make in order to progress towards some goal.
Users construct an apdaptive process via the init methods. Theinit(File)
method gives the adaptive process a backing store
so that upon shutdown, the process is saved to file
(see the init
methods for details).
New adaptives are created via the initAdaptive method.
Users indicate success or failure of the adaptation process via the
reward method.
Method Summary | ||
---|---|---|
void |
disableAutosave()
In general persisted adaptive processes (those constructed with init(File)) will be automatically saved when the program shuts down; this disables that feature. |
|
void |
disableLearning()
Disables learning on all adaptives managed by this process. |
|
void |
dumpTable(java.io.OutputStream os)
Dumps some representation of the current values in the table (as HTML) WARNING: This method is experimental and may be removed in later releases. |
|
void |
enableLearning()
Enables learning on all adaptives managed by this process. |
|
void |
endEpisode()
Separates one sequence of choices and rewards from another independent sequence of choices and rewards in the same process during learning. |
|
static AdaptiveProcess |
init()
Initialize a temporary adaptive process that is not automatically persisted to file when the program terminates. |
|
static AdaptiveProcess |
init(java.io.File file)
Constructs a new adaptive from the contents of a file. |
|
|
initAdaptive(java.lang.Class<C> contextClass,
java.lang.Class<A> actionClass)
This constructs a new adaptive or binds to an existing one. |
|
void |
reward(double r)
Specifies a numeric value as feedback for the choices made during learning. |
|
void |
save(java.io.File f)
Persists the adaptive process to file explicitly. |
|
void |
setSeed(long seed)
Sets this initial random seed to be used in all freshly constructed random number generators in the system. |
|
long |
totalEpisodes()
The total number of times that endEpisode has been called. |
|
double |
totalReward()
Returns the total reward this process is accumulated for all program runs. |
|
double |
totalRewardSingleRun()
Returns the total reward sum on this run. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AdaptiveProcess init()
init(File)
public static AdaptiveProcess init(java.io.File file) throws java.io.IOException
java.io.IOException
- if the file exists, but is somehow malformed or some other IO error is encounteredsave(java.io.File)
,
init()
public <C,A> Adaptive<C,A> initAdaptive(java.lang.Class<C> contextClass, java.lang.Class<A> actionClass)
init(File)
,
then this will return the adaptives in their initial creation order.
public long totalEpisodes()
endEpisode
has been called.
endEpisode()
public double totalRewardSingleRun()
public double totalReward()
public void setSeed(long seed)
-1L
indicates a non-deterministic seed (e.g. the
system timer) should be used.
public void save(java.io.File f) throws java.io.IOException
AdaptiveProcess.init(File)
, then calling this is
unnecessary as we add a shutdown hook to save back to that file
upon program shutdown.
java.io.IOException
init()
public void disableLearning()
Adaptive.disableLearningfor a discussion of what this means.
Adaptive.enableLearning()
,
enableLearning()
public void enableLearning()
Adaptive.disableLearningfor a discussion of what this means.
Adaptive.disableLearning()
,
disableLearning()
public void disableAutosave()
init(File)
public void reward(double r)
Adaptive.suggest(C, java.util.Set)
public void endEpisode()
public void dumpTable(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |