concepts.pdsketch.domain.State#
- class State[source]#
Bases:
NamedObjectTensorState
Planning domain state.
Methods
clone
()Clone the internal state of the state.
Extra state string.
Extra state string: add the objects.
generate_tuple_description
(domain)Generate a tuple description of the state.
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.
init_dirty_feature
(function)Initialize a dirty feature.
simple_quantize
(domain[, features])Make a quantized version of the state.
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:
- 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.
- init_dirty_feature(function)[source]#
Initialize a dirty feature. A dirty feature is a cacheable feature but not in the original state representation. The convention for dirty features is that they are initialized with optimistic values being OPTIM_MAGIC_NUMBER_MAGIC.
- Parameters:
function (Function) – the feature to initialize.
- 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#