Pipeline

class lifesimmc.core.pipeline.Pipeline(seed: int | None = None, gpu_index: int | None = None, grid_size: int = 40, time_step_size: float | None = None, device: device | None = None)

Class representation of the pipeline.

Parameters:
  • seed (int) – The seed for the random number generator.

  • gpu_index (int) – The index of the GPU to use.

  • grid_size (int) – The size of the grid.

  • time_step_size (float) – The size of the time step.

  • device (torch.device) – The device to use for the simulation.

  • _modules (list) – The list of modules in the pipeline.

  • _resources (dict) – The dictionary of resources in the pipeline.

Pipeline.add_module(module: BaseModule)

Add a module to the pipeline.

Parameters:

module (BaseModule) – The module to add to the pipeline.

Pipeline.get_resource(name: str) BaseResource | None

Get a resource by name.

Parameters:

name (str) – The name of the resource to get.

Returns:

The resource if found, otherwise None.

Return type:

BaseResource or None

Pipeline.run()

Run the pipeline with all the modules that have been added. Remove the modules after running.