babylon.models.components.vitality

VitalityComponent - Population and survival needs of an entity.

VitalityComponent represents the population and basic survival requirements of an entity in the Babylon simulation. It tracks the size of the population and the resources needed for subsistence.

This component is essential for the survival calculus in the simulation.

Classes

VitalityComponent(**data)

Population and survival needs of an entity.

class babylon.models.components.vitality.VitalityComponent(**data)[source]

Bases: BaseModel

Population and survival needs of an entity.

Tracks the demographic and subsistence state of an entity: - Population size (Currency) - Minimum resources required for survival (Currency)

All values use constrained types for automatic validation: - population, subsistence_needs: Currency [0, inf)

This component is immutable (frozen) to ensure state integrity.

Parameters:
population

Size of the population (default: 1.0)

subsistence_needs

Resources needed for survival (default: 5.0)

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

population: Annotated[float]
subsistence_needs: Annotated[float]
property component_type: str

Return the component type identifier.

Returns:

The string ‘vitality’ identifying this component type.