concepts.dm.crow.domain.CrowState#
- class CrowState[source]#
Bases:
NamedObjectTensorState
Methods
clone
()Clone the internals.
Extra state string.
Extra state string: add the objects.
fast_set_value
(feature_name, indices, value)get_nr_objects_by_type
(typename)Get the number of objects with the given type.
get_typed_index
(name[, typename])Get the typed index of the object with the given name.
get_typename
(name)Get the typename of the object with the given name.
make_empty_state
(domain, objects)Get a summary string of the state.
Attributes
The number of batchified dimensions.
Additional internal information about the state.
The number of objects in the current state.
- __init__(features, object_names, object_types=None, batch_dims=0, internals=None)#
Initialize the state.
- Parameters:
features (Mapping[str, Any] | MultidimensionalArrayInterface | None) – the features of the state.
object_types (Iterable[ObjectType] | None) – the types of the objects.
object_names (Iterable[str] | Mapping[str, ObjectType]) – the names of the objects. If the object_names is a mapping, the object_types should be None.
batch_dims (int) – the number of batchified dimensions.
internals (Mapping[str, Any] | None) – the internals of the state.
- __new__(**kwargs)#
- clone()#
- Return type:
- clone_internals()#
Clone the internals.
- get_nr_objects_by_type(typename)#
Get the number of objects with the given type.
- 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).
- get_typename(name)#
Get the typename of the object with the given name.
- classmethod make_empty_state(domain, objects)[source]#
- Parameters:
domain (CrowDomain) –
- 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:
- property features: TensorValueDict#