|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rlcommunity.rlglue.utilities.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. |
Method Summary | |
---|---|
java.lang.String |
dump()
Returns a string containing debug information about the Task Spec. |
int |
getActionDim()
Gets the size of the action array (Number of actions) |
double[] |
getActionMaxs()
Gets the array of maxs for the actions. |
double[] |
getActionMins()
Gets the array of mins for the actions. |
char[] |
getActionTypes()
Gets the types for the actions. |
char |
getEpisodic()
Gets the episodic characteristic of the Task Spec. |
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()
Gets the size of the observation array (Number of observations) |
double[] |
getObsMaxs()
Gets the array of maxs for the observations. |
double[] |
getObsMins()
Gets the array of mins for the observations. |
char[] |
getObsTypes()
Gets the types for the observations. |
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. |
double |
getTaskSpecVersion()
Gets the version of the Task spec. |
int |
getVersion()
Gets the Task Spec version. |
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. |
void |
setActionDim(int dim)
Set the size of the action array. |
void |
setActionMaxs(double[] maxs)
Sets the array of maxs for the actions. |
void |
setActionMins(double[] mins)
Sets the array of mins for the actions. |
void |
setActionTypes(char[] types)
Sets the types for the actions. |
void |
setEpisodic(char episodic)
Set the episodec character in the Task Spec. |
void |
setExtraString(java.lang.String newString)
Sets the string value for the ExtraString. |
void |
setNumContinuousActionDims(int numCont)
Sets the number of continous actions. |
void |
setNumContinuousObsDims(int numCont)
Sets the number of continuous observations. |
void |
setNumDiscreteActionDims(int numDisc)
Sets the number of descrete actions. |
void |
setNumDiscreteObsDims(int numDisc)
Sets the number of descrete observations. |
void |
setobsDim(int dim)
Set the size of the observation array. |
void |
setObsMaxs(double[] maxs)
Sets the array of maxs for the observations. |
void |
setObsMins(double[] mins)
Sets the array of mins for the observations. |
void |
setObsTypes(char[] types)
Sets the types for the observations. |
void |
setRewardMax(double max)
Sets the max reward. |
void |
setRewardMin(double min)
Sets the min reward. |
void |
setVersion(int version)
Set the version of the Task Spec. |
java.lang.String |
toString()
Returns the string representation of the Task Spec object. |
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 languageMethod Detail |
---|
public int getVersion()
none
-
public java.lang.String toString()
toString
in class java.lang.Object
none
-
public java.lang.String dump()
none
-
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()
none
-
public boolean isMaxRewardInf()
none
-
public boolean isMinRewardUnknown()
none
-
public boolean isMaxRewardUnknown()
none
-
public double getTaskSpecVersion()
none
-
public void setVersion(int version)
version
- Integer representing the version of the Task Spec.public char getEpisodic()
none
-
public void setEpisodic(char episodic)
episodic
- Character representing whether an environment is episodic.public int getObsDim()
none
-
public void setobsDim(int dim)
dim
- Integer for the size of the observation array.public int getNumDiscreteObsDims()
none
-
public void setNumDiscreteObsDims(int numDisc)
numDisc
- Integer number of descrete observations.public int getNumContinuousObsDims()
none
-
public void setNumContinuousObsDims(int numCont)
numDisc
- Integer number of continuous observations.public char[] getObsTypes()
none
-
public void setObsTypes(char[] types)
types
- Character array representing the types of the observations.public double[] getObsMins()
none
-
public void setObsMins(double[] mins)
mins
- array of doubles corresponding to the mins for the
observations.public double[] getObsMaxs()
none
-
public void setObsMaxs(double[] maxs)
mins
- array of doubles corresponding to the maxs for the
observations.public int getActionDim()
none
-
public void setActionDim(int dim)
dim
- Integer for the size of the action array.public int getNumDiscreteActionDims()
none
-
public void setNumDiscreteActionDims(int numDisc)
numDisc
- Integer number of descrete actions.public int getNumContinuousActionDims()
none
-
public void setNumContinuousActionDims(int numCont)
numDisc
- Integer number of continous actions.public char[] getActionTypes()
none
-
public void setActionTypes(char[] types)
types
- Character array representing the types of the actions.public double[] getActionMins()
none
-
public void setActionMins(double[] mins)
mins
- Double array of values corresponding to action min values.public double[] getActionMaxs()
none
-
public void setActionMaxs(double[] maxs)
mins
- Double array of values corresponding to action max values.public double getRewardMax()
none
-
public void setRewardMax(double max)
max
- Double value of the max rewardpublic double getRewardMin()
none
-
public void setRewardMin(double min)
min
- Double value of the min reward.public java.lang.String getExtraString()
none
-
public void setExtraString(java.lang.String newString)
newString
- the new string to be appended to the TaskSpec.public int getParserVersion()
none
-
public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |