class vivarium.framework.resource.resource.ResourceId(resource_type, name)[source]

A string representing the unique identifier for a resource, including its type.

Parameters:
  • resource_type (str)

  • name (str)

Return type:

ResourceId

resource_type: str
name: str
class vivarium.framework.resource.resource.Resource(name, component, required_resources=())[source]

A generic resource representing a node in the dependency graph.

Parameters:
RESOURCE_TYPE = 'generic_resource'

The type of the resource. Should be overridden by subclasses.

name

The name of the resource.

on_dependencies_changed: Callable[[], None] | None

Optional callback invoked when this resource’s dependencies change. Set by the ResourceManager when the resource is registered.

notify_dependencies_changed()[source]

Notify the resource manager that this resource’s dependencies have changed.

Return type:

None

property component: Component | Manager

The component that creates the resource.

property resource_id: ResourceId

The long name of the resource, including the type.

property required_resources: list[ResourceId]

The long names (including type) of required resources for this group.

static get_callable_name(callable_)[source]

Get reproducible names based on the callable type.

Return type:

str

Parameters:

callable_ (Callable[[...], Any])

classmethod get_resource_id(name)[source]

Get a resource id for a resource with the given name and this resource’s type.

Return type:

ResourceId

Parameters:

name (str)

class vivarium.framework.resource.resource.Initializer(index, component, initializer, required_resources)[source]

A resource representing a method for initializing simulant state.

Parameters:
initializer

The initializer method that this resource represents.

RESOURCE_TYPE = 'initializer'

The type of the resource.

class vivarium.framework.resource.resource.Column(name, component, required_resources=())[source]

A resource representing a column in the population private data.

Parameters:
RESOURCE_TYPE = 'column'

The type of the resource.