|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rlcommunity.rlglue.codec.taskspec.TaskSpec
public class TaskSpec
This class is used to store and parse the information given to an Agent in the RL-Glue framework. The Task Spec stores information the Agent needs regarding the environment, such as the number of actions, observations, and their ranges. For more information please read the RL-Glue Task Spec info
This class was written to handle future revisions to the Task Spec while providing backwards compatibility with old Task Spec versions. This is accomplished through the use of the factory design pattern. The TaskSpecDelegate object is the medium through which the TaskSpec communicates with different implementations of the Task Spec versions. So far, each Task Spec version has incrementally added functionality, but this might not always be the case, so this framework was designed to robustly accomodate future versions.
Constructor Summary | |
---|---|
TaskSpec(java.lang.String taskSpec)
Constructor that takes a string adhereing to the Task Spec language protocol. |
|
TaskSpec(TaskSpecDelegate theTaskSpecDelegate)
|
Method Summary | |
---|---|
static boolean |
checkTaskSpec(java.lang.String theTaskSpecString)
Quick sanity check. |
java.lang.String |
dump()
Deprecated. This is dumb. |
int |
getActionDim()
Gets the size of the action array (Number of actions) |
double[] |
getActionMaxs()
Deprecated. I don't like this anymore. |
double[] |
getActionMins()
Deprecated. I don't like this anymore. |
char[] |
getActionTypes()
Deprecated. I don't like this anymore. |
DoubleRange |
getContinuousActionRange(int i)
Get the min, max, and special information for the i'th double action. |
DoubleRange |
getContinuousObservationRange(int i)
Get the min, max, and special information for the i'th double observation. |
double |
getDiscountFactor()
Get the discount factor. |
IntRange |
getDiscreteActionRange(int i)
Get the min, max, and special information for the i'th integer action. |
IntRange |
getDiscreteObservationRange(int i)
Get the min, max, and special information for the i'th integer observation. |
char |
getEpisodic()
Deprecated. use getProblemType() |
java.lang.String |
getExtraString()
Gets the string value for the ExtraString. |
int |
getNumContinuousActionDims()
Gets the number of continous actions |
int |
getNumContinuousObsDims()
Gets the number of continuous observations. |
int |
getNumDiscreteActionDims()
Gets the number of descrete actions |
int |
getNumDiscreteObsDims()
Gets the number of descrete observations. |
int |
getObsDim()
Deprecated. This is useless. |
double[] |
getObsMaxs()
Deprecated. I don't like this anymore. |
double[] |
getObsMins()
Deprecated. I don't like this anymore. |
char[] |
getObsTypes()
Deprecated. I don't like this anymore. |
int |
getParserVersion()
Gets the version of the parser used on the Task Spec. |
double |
getRewardMax()
Gets the max reward. |
double |
getRewardMin()
Gets the min reward. |
DoubleRange |
getRewardRange()
Get the range of rewards |
java.lang.String |
getStringRepresentation()
Returns the string representation of the Task Spec object. |
double |
getTaskSpecVersion()
Deprecated. Use getVersionString |
int |
getVersion()
Deprecated. Moving to a string version |
java.lang.String |
getVersionString()
|
boolean |
isActionMaxPosInfinity(int index)
Checks if the action max at index is positive infinity. |
boolean |
isActionMaxUnknown(int index)
Checks if the action max at index is unknown. |
boolean |
isActionMinNegInfinity(int index)
Checks if the action min at index is negative infinity. |
boolean |
isActionMinUnknown(int index)
Checks if the min action at index is unknown. |
boolean |
isMaxRewardInf()
Checks if the max reward is positive infinity. |
boolean |
isMaxRewardUnknown()
Checks if the max reward is unknown. |
boolean |
isMinRewardNegInf()
Checks if the min reward is negative infinity. |
boolean |
isMinRewardUnknown()
Checks if the min reward is unknown. |
boolean |
isObsMaxPosInfinity(int index)
Checks if the observation max at index is positive infinity. |
boolean |
isObsMaxUnknown(int index)
Checks if the observation max at index is unknown. |
boolean |
isObsMinNegInfinity(int index)
Checks if the observation min at index is negative infinity. |
boolean |
isObsMinUnknown(int index)
Checks if the observation min at index is unknown. |
static void |
main(java.lang.String[] args)
Main has no purpose in this class other than for debugging. |
java.lang.String |
toString()
Deprecated. We never should have overloaded toString in this way. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TaskSpec(java.lang.String taskSpec)
taskSpec
- String following the Task Spec languagepublic TaskSpec(TaskSpecDelegate theTaskSpecDelegate)
Method Detail |
---|
public int getVersion()
public static boolean checkTaskSpec(java.lang.String theTaskSpecString)
theTaskSpecString
-
public java.lang.String getVersionString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStringRepresentation()
public java.lang.String dump()
public boolean isObsMinNegInfinity(int index)
index
- Integer index of the obs_min array.
public boolean isActionMinNegInfinity(int index)
index
- - integer index of the action_mins array.
public boolean isObsMaxPosInfinity(int index)
index
- Interger index of the obs_maxs array.
public boolean isActionMaxPosInfinity(int index)
index
- Integer index of the action_maxs array.
public boolean isObsMinUnknown(int index)
index
- Integer index of the obs_mins array.
public boolean isObsMaxUnknown(int index)
index
- Integer index of the obs_max array.
public boolean isActionMinUnknown(int index)
index
- Integer index of the action_mins array.
public boolean isActionMaxUnknown(int index)
index
- Integer index of the action_maxs array.
public boolean isMinRewardNegInf()
public boolean isMaxRewardInf()
public boolean isMinRewardUnknown()
public boolean isMaxRewardUnknown()
public double getTaskSpecVersion()
public char getEpisodic()
public int getObsDim()
public int getNumDiscreteObsDims()
public int getNumContinuousObsDims()
public char[] getObsTypes()
public double[] getObsMins()
public double[] getObsMaxs()
public int getActionDim()
public int getNumDiscreteActionDims()
public int getNumContinuousActionDims()
public char[] getActionTypes()
public double[] getActionMins()
public double[] getActionMaxs()
public double getRewardMax()
public double getRewardMin()
public java.lang.String getExtraString()
public int getParserVersion()
public static void main(java.lang.String[] args)
args
- public double getDiscountFactor()
public IntRange getDiscreteObservationRange(int i)
i
- public IntRange getDiscreteActionRange(int i)
i
- public DoubleRange getContinuousObservationRange(int i)
i
- public DoubleRange getContinuousActionRange(int i)
i
- public DoubleRange getRewardRange()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |