public static class LearningAgent.LearningAgentBookKeeping
extends java.lang.Object
LearningAgent
is an interface, default methods for managing
the history of experienced episodes is not provided. Therefore, this class provides the requisite data members
and default methods for making that bookkeeping easy. This allows a class that implements the
LearningAgent
interface to simply have a data member for this
class and allow it to manage the methods.
All data members of this class are public. By default the history of learning episodes stored will be just
1. This method also includes a data member maxEpisodeSize
which can be optionally used for setting the longest
time a learning agent will run when the LearningAgent.runLearningEpisodeFrom(burlap.oomdp.core.State)
method is called. By default, it is INT MAX.
The class also has a method for automatically adding an episode to its history, will removing the oldest stored
episode if the the size of the history is larger than the max history size.Modifier and Type | Field and Description |
---|---|
java.util.LinkedList<EpisodeAnalysis> |
episodeHistory
The history of learning episodes
|
int |
maxEpisodeSize |
int |
numEpisodesToStore |
Constructor and Description |
---|
LearningAgent.LearningAgentBookKeeping() |
Modifier and Type | Method and Description |
---|---|
java.util.List<EpisodeAnalysis> |
getAllStoredLearningEpisodes()
Returns all saved
EpisodeAnalysis objects of which the agent has kept track. |
EpisodeAnalysis |
getLastLearningEpisode()
Returns the last learning episode of the agent.
|
void |
offerEpisodeToHistory(EpisodeAnalysis ea)
Adds episode ea to this objects history of experienced episodes.
|
void |
setNumEpisodesToStore(int numEps)
Tells the agent how many
EpisodeAnalysis objects representing learning episodes to internally store. |
public java.util.LinkedList<EpisodeAnalysis> episodeHistory
public int numEpisodesToStore
public int maxEpisodeSize
public LearningAgent.LearningAgentBookKeeping()
public EpisodeAnalysis getLastLearningEpisode()
public void setNumEpisodesToStore(int numEps)
EpisodeAnalysis
objects representing learning episodes to internally store.
For instance, if the number of set to 5, then the agent should remember the save the last 5 learning episodes. Note that this number
has nothing to do with how learning is performed; it is purely for performance gathering.numEps
- the number of learning episodes to remember.public java.util.List<EpisodeAnalysis> getAllStoredLearningEpisodes()
EpisodeAnalysis
objects of which the agent has kept track.EpisodeAnalysis
objects of which the agent has kept track.public void offerEpisodeToHistory(EpisodeAnalysis ea)
ea
- the episode to add to the history of experienced episodes.