rlang.grounding.utils package

rlang.grounding.utils.grounding_exceptions module

exception rlang.grounding.utils.grounding_exceptions.RLangGroundingError[source]

Bases: Exception

__init__(message)[source]
Parameters

message (str) –

rlang.grounding.utils.primitives module

class rlang.grounding.utils.primitives.Primitive[source]

Bases: ndarray

Represents a batched real-valued object.

States and Actions should be easily batchable. This takes care of that.

static __new__(cls, input_array)[source]
Parameters

input_array (Any) –

class rlang.grounding.utils.primitives.VectorState[source]

Bases: State, Primitive

Represents a state that is a vector.

Parameters

input_array – a numpy array or list representing a state or set of states.

Examples

s1 = VectorState(3)
>> VectorState([3])
s2 = VectorState([3, 4])
>> VectorState([3, 4])
class rlang.grounding.utils.primitives.Action[source]

Bases: Primitive

Represents an action that is a vector.

Parameters

input_array – a numpy array or list representing an action or set of actions.

Examples

s1 = Action(3)
>> Action([3])
s2 = Action([3, 4])
>> Action([3, 4])
class rlang.grounding.utils.primitives.MDPObject[source]

Bases: object

Represents an object in an Object-Oriented MDP.

Inherit this class to create a new object class.

__init__(name)[source]
Parameters

name (str) – the name for this object class.

class rlang.grounding.utils.primitives.ObjectOrientedState[source]

Bases: State

Represents a state for an object-oriented MDP.

Examples

color = MDPObject(name="color")
color.red = 256
oo_state = ObjectOrientedState(objects={color})
>> <ObjectOrientedState {<MDPObject {'name': 'color', 'red': 256}>}>
__init__(objects)[source]
Parameters

objects (set) – a set of objects, which should be instances of subclasses of MDPObject.

rlang.grounding.utils.utils module

class rlang.grounding.utils.utils.Domain[source]

Bases: Enum

Enum representing the domain or codomain of a OldGroundingFunction

Domain enums can be automatically combined using an addition operation:

Domain.STATE + Domain.ACTION == Domain.STATE_ACTION
class rlang.grounding.utils.utils.MDPMetadata[source]

Bases: object

Class for holding metadata on an MDP like the state and action representations.

__init__(state_representation)
Parameters

state_representation (Type[State]) –

Return type

None