pycram.parameterizer#

Classes#

Parameterizer

Class that generates possible parameters for a plan.

Functions#

collision_free_event(→ random_events.product_algebra.Event)

Create an event that describes the free space of the world.

update_variables_of_simple_event(...)

update_variables_of_event(...)

leaf_type_to_variable(→ random_events.variable.Variable)

Convert a leaf type to a random events variable.

Module Contents#

class pycram.parameterizer.Parameterizer#

Class that generates possible parameters for a plan.

This class can be used to generate possible parameters for a plan from probability distributions.

plan: pycram.plan.Plan#

The plan to generate the parameters for.

parameters: Dict[pycram.plan.DesignatorNode, Any]#

A dictionary that maps all nodes in the plan that hold actions to their parameters.

variables_of_node: Dict[pycram.plan.DesignatorNode, List[random_events.variable.Variable]]#

A dictionary that maps all nodes in the plan that hold actions to the variables that describe that nodes parameters.

__post_init__()#
property variables: List[random_events.variable.Variable]#
Returns:

The variables for all parameters in the plan.

get_variable(name: str) random_events.variable.Variable#
Parameters:

name – The name of the variable.

Returns:

The variable.

make_parameters()#

Create the parameters for all relevant nodes in the plan.

make_variables()#

Create the variables for all relevant parameters in the plan.

plan_from_sample(model: probabilistic_model.probabilistic_model.ProbabilisticModel, sample: numpy.ndarray, world: semantic_digital_twin.world.World) pycram.plan.Plan#

Create a sequential plan from a sample of all parameters.

Parameters:
  • model – The model that generated the sample.

  • sample – The sample to generate the plan from.

  • world – The world to create the plan in.

Returns:

The executable, sequential plan

create_fully_factorized_distribution() probabilistic_model.probabilistic_circuit.rx.probabilistic_circuit.ProbabilisticCircuit#
Returns:

a fully factorized distribution for the plan.

create_restrictions() random_events.product_algebra.SimpleEvent#
Returns:

The restrictions present in the plan as random event.

pycram.parameterizer.collision_free_event(world: semantic_digital_twin.world.World, search_space: semantic_digital_twin.world_description.shape_collection.BoundingBoxCollection | None = None) random_events.product_algebra.Event#

Create an event that describes the free space of the world. :param world: The world to create the event from. :param search_space: The search space to limit the collision free event to. :return: An event that describes the free space.

pycram.parameterizer.update_variables_of_simple_event(event: random_events.product_algebra.SimpleEvent, new_variables: Dict[random_events.variable.Variable, random_events.variable.Variable]) random_events.product_algebra.SimpleEvent#
pycram.parameterizer.update_variables_of_event(event: random_events.product_algebra.Event, new_variables: Dict[random_events.variable.Variable, random_events.variable.Variable]) random_events.product_algebra.Event#
pycram.parameterizer.leaf_type_to_variable(name: str, leaf_type: Type) random_events.variable.Variable#

Convert a leaf type to a random events variable. :param name: The name of the variable. :param leaf_type: The leaf type. :return: The variable.