concepts.dm.crow.crow_domain.CrowState#

class CrowState[source]#

Bases: NamedObjectTensorState

Methods

batch_set_value(feature_name, value)

clone()

clone_internals()

Clone the internals.

extra_state_str_after()

Extra state string.

extra_state_str_before()

Extra state string: add the objects.

fast_set_value(feature_name, indices, value)

get_default_typename(name)

Get the typename of the object with the given name.

get_name(typename, index)

Get the name of the object with the given type and index.

get_nr_objects_by_type(typename)

Get the number of objects with the given type.

get_objects_by_type(typename)

Get the names of the objects with the given type.

get_state_object_list(dtype[, indices, names])

Get a list of object references with the given type and indices.

get_state_object_reference(dtype[, index, name])

Get the object reference with the given type and index.

get_typed_index(name[, typename])

Get the typed index of the object with the given name.

make_empty_state(domain, objects)

summary_string()

Get a summary string of the state.

Attributes

batch_dims

The number of batchified dimensions.

features

internals

Additional internal information about the state.

nr_objects

The number of objects in the current state.

__getitem__(name)#
Parameters:

name (str)

__init__(features, object_names, object_types=None, batch_dims=0, internals=None)#

Initialize the state.

Parameters:
__new__(**kwargs)#
batch_set_value(feature_name, value)[source]#
Parameters:
Return type:

None

clone()#
Return type:

NamedObjectTensorState

clone_internals()#

Clone the internals.

extra_state_str_after()#

Extra state string.

Return type:

str

extra_state_str_before()#

Extra state string: add the objects.

Return type:

str

fast_set_value(feature_name, indices, value)[source]#
Parameters:
get_default_typename(name)#

Get the typename of the object with the given name.

Parameters:

name (str)

Return type:

str

get_name(typename, index)#

Get the name of the object with the given type and index.

Parameters:
Return type:

str

get_nr_objects_by_type(typename)#

Get the number of objects with the given type.

Parameters:

typename (str)

Return type:

int

get_objects_by_type(typename)#

Get the names of the objects with the given type.

Parameters:

typename (str)

Return type:

List[str]

get_state_object_list(dtype, indices=None, names=None)#

Get a list of object references with the given type and indices.

Parameters:
Return type:

StateObjectList

get_state_object_reference(dtype, index=None, name=None)#

Get the object reference with the given type and index.

Parameters:
Return type:

StateObjectReference

get_typed_index(name, typename=None)#

Get the typed index of the object with the given name. There is an additional typename argument to specify the type of the object. Because the same object can have multiple types (due to inheritence), the object can have multiple typed indices, one for each type. When the typename is not specified, the default type of the object is used (i.e., the most specific type).

Parameters:
  • name (str) – the name of the object.

  • typename (str | None) – the typename of the object. If not specified, the default type of the object is used (i.e. the most specific type).

Returns:

the typed index of the object.

Return type:

int

classmethod make_empty_state(domain, objects)[source]#
Parameters:
summary_string()#

Get a summary string of the state. The main difference between this and __str__ is that this function only formats the shape of intermediate tensors.

Return type:

str

property batch_dims: int#

The number of batchified dimensions. For the basic State, it should be 0.

property features: TensorValueDict#
property internals: Dict[str, Any]#

Additional internal information about the state.

property nr_objects: int#

The number of objects in the current state.