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
|
Population and survival needs of an entity. |
- class babylon.models.components.vitality.VitalityComponent(**data)[source]
Bases:
BaseModelPopulation 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.
- 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].