public class OOStateUtilities
extends java.lang.Object
OOState instances.| Modifier and Type | Method and Description |
|---|---|
static java.util.List<java.lang.Object> |
flatStateKeys(OOState s)
Returns all object-variable_key keys.
|
static OOVariableKey |
generateKey(java.lang.Object key)
Generates an
OOVariableKey from a key that is either already an OOVariableKey or a string representation of one. |
static java.lang.Object |
get(OOState s,
java.lang.Object variableKey)
Returns the value of an
ObjectInstance variable, where the key is a OOVariableKey or a string
representation of an OOVariableKey. |
static java.util.List<java.util.List<java.lang.String>> |
getPossibleBindingsGivenParamOrderGroups(OOState s,
java.lang.String[] paramClasses,
java.lang.String[] paramOrderGroups)
Returns all possible object assignments from a
OOState for a given set of parameters that are typed
to OO-MDP object classes. |
static java.util.Set<java.lang.String> |
objectClassesPresent(OOState s)
Returns the set of object classes that have instantiated
ObjectInstances in the input state. |
static <T extends ObjectInstance> |
objectIndexWithName(java.util.List<T> objects,
java.lang.String name)
Returns the index of an
ObjectInstance with the given name in a list |
static java.lang.String |
objectInstanceToString(ObjectInstance o)
A common approach for turning an
ObjectInstance into a string representation. |
static java.util.Map<java.lang.String,java.util.List<ObjectInstance>> |
objectsByClass(OOState s)
Returns a list of list of
ObjectInstances where the objects are organized by their class. |
static <T extends ObjectInstance> |
objectWithName(java.util.List<T> objects,
java.lang.String name)
Returns the
ObjectInstance with the given name |
static java.lang.String |
ooStateToString(OOState s)
A common approach for turning an
OOState into a string representation. |
public static <T extends ObjectInstance> T objectWithName(java.util.List<T> objects, java.lang.String name)
ObjectInstance with the given nameT - the type of the ObjectInstanceobjects - a list ObjectInstancesname - the name of the query ObjectInstanceObjectInstance or null if it is not foundpublic static <T extends ObjectInstance> int objectIndexWithName(java.util.List<T> objects, java.lang.String name)
ObjectInstance with the given name in a listT - the type of the ObjectInstanceobjects - a list ObjectInstancesname - the name of the query ObjectInstanceObjectInstance or -1 if it is not foundpublic static java.util.List<java.lang.Object> flatStateKeys(OOState s)
State.variableKeys() method.s - the input statepublic static java.lang.Object get(OOState s, java.lang.Object variableKey)
ObjectInstance variable, where the key is a OOVariableKey or a string
representation of an OOVariableKey.s - the input statevariableKey - the object-variable keypublic static OOVariableKey generateKey(java.lang.Object key)
OOVariableKey from a key that is either already an OOVariableKey or a string representation of one.key - an OOVariableKey or a string representation of one.OOVariableKeypublic static java.util.Map<java.lang.String,java.util.List<ObjectInstance>> objectsByClass(OOState s)
ObjectInstances where the objects are organized by their class.s - the input OOStateObjectInstances organized by their classpublic static java.util.Set<java.lang.String> objectClassesPresent(OOState s)
ObjectInstances in the input state.s - the input stateObjectInstances in the input state.public static java.lang.String ooStateToString(OOState s)
OOState into a string representation. Useful for implementing
Object.toString() methods.s - the input OOStatepublic static java.lang.String objectInstanceToString(ObjectInstance o)
ObjectInstance into a string representation. Useful for implementing the
Object.toString() method.o - the input ObjectInstancepublic static java.util.List<java.util.List<java.lang.String>> getPossibleBindingsGivenParamOrderGroups(OOState s, java.lang.String[] paramClasses, java.lang.String[] paramOrderGroups)
OOState for a given set of parameters that are typed
to OO-MDP object classes. For example, parameters for a PropositionalFunction
or ObjectParameterizedAction.s - the OOStateparamClasses - the object class type for a parameter array that needs object assignmentsparamOrderGroups - indicates the order group of a parameter. Parameters in the same
order group can have their object assignments shuffled without affecting the evaluation.
By default, you probably can have a unique order group for each parameters