babylon.models.entities.social_class
SocialClass entity model.
A SocialClass is the fundamental node type in the Babylon simulation. It represents a social class in the world system, defined by: 1. Its relationship to the means of production (SocialRole) 2. Its material conditions (wealth, subsistence threshold) 3. Its ideological position (multi-dimensional consciousness model) 4. Its survival calculus outputs (P(S|A), P(S|R))
This is the Phase 1 node type from the four-phase blueprint.
Sprint 3.4.3 (George Jackson Refactor): Replaced scalar ideology with multi-dimensional IdeologicalProfile containing: - class_consciousness: Relationship to Capital [0=False, 1=Revolutionary] - national_identity: Relationship to State/Tribe [0=Internationalist, 1=Fascist] - agitation: Raw political energy from crisis (falling wages)
Classes
|
Economic material conditions of a social class. |
|
Ideological state of a social class (legacy component view). |
|
Multi-dimensional ideological state of a social class. |
|
Material conditions affecting a social class. |
|
A social class in the world system. |
|
Survival calculus outputs for a social class. |
- class babylon.models.entities.social_class.EconomicComponent(**data)[source]
Bases:
BaseModelEconomic material conditions of a social class.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class babylon.models.entities.social_class.IdeologicalProfile(**data)[source]
Bases:
BaseModelMulti-dimensional ideological state of a social class.
Sprint 3.4.3 (George Jackson Refactor): This model replaces the scalar ideology field with a multi-dimensional consciousness model.
The key insight: “Fascism is the defensive form of capitalism.” - Agitation + Solidarity -> Class Consciousness (Revolutionary Path) - Agitation + No Solidarity -> National Identity (Fascist Path)
- Parameters:
- class_consciousness
Relationship to Capital [0.0=False, 1.0=Revolutionary] How clearly the class understands its position relative to capital.
- national_identity
Relationship to State/Tribe [0.0=Internationalist, 1.0=Fascist] How strongly the class identifies with nation/race over class.
- agitation
Raw political energy from crisis [0.0, inf) Accumulated energy from falling wages, crisis conditions. Routes to either axis based on solidarity_pressure.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_legacy_ideology(ideology_value)[source]
Convert legacy scalar ideology [-1, 1] to IdeologicalProfile.
Legacy mapping: - ideology=-1 (revolutionary) -> class_consciousness=1.0, national_identity=0.0 - ideology=0 (neutral) -> class_consciousness=0.5, national_identity=0.5 - ideology=+1 (reactionary) -> class_consciousness=0.0, national_identity=1.0
- Parameters:
ideology_value (
float) – Legacy ideology scalar in range [-1.0, 1.0]- Return type:
- Returns:
IdeologicalProfile with mapped values
- class babylon.models.entities.social_class.IdeologicalComponent(**data)[source]
Bases:
BaseModelIdeological state of a social class (legacy component view).
- Parameters:
ideology (IdeologicalProfile)
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- ideology: IdeologicalProfile
- class babylon.models.entities.social_class.SurvivalComponent(**data)[source]
Bases:
BaseModelSurvival calculus outputs for a social class.
- Parameters:
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class babylon.models.entities.social_class.MaterialConditionsComponent(**data)[source]
Bases:
BaseModelMaterial conditions affecting a social class.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class babylon.models.entities.social_class.SocialClass(**data)[source]
Bases:
BaseModelA social class in the world system.
The fundamental unit of the simulation. Classes are defined by their relationship to production and their position in the imperial hierarchy.
This model uses Sprint 1 constrained types for automatic validation: - Currency: [0, inf) for wealth, subsistence_threshold - IdeologicalProfile: Multi-dimensional consciousness model (Sprint 3.4.3) - Probability: [0, 1] for survival probabilities and organization/repression
- Parameters:
id (Annotated[str, _PydanticGeneralMetadata(pattern='^C[0-9]{3}$')])
role (SocialRole)
description (str)
ideology (IdeologicalProfile)
- id
Unique identifier matching pattern ^C[0-9]{3}$
- name
Human-readable name for the class
- role
Position in the world system (SocialRole enum)
- description
Optional detailed description
- wealth
Economic resources (Currency, default 10.0)
- ideology
Multi-dimensional ideological profile (IdeologicalProfile)
- p_acquiescence
P(S|A) - survival probability through acquiescence (Probability)
- p_revolution
P(S|R) - survival probability through revolution (Probability)
- subsistence_threshold
Minimum wealth for survival (Currency, default 5.0)
- organization
Collective cohesion/class consciousness (Probability, default 0.1)
- repression_faced
State violence directed at this class (Probability, default 0.5)
- Legacy Compatibility:
If a float value is passed for ideology, it will be automatically converted to an IdeologicalProfile using from_legacy_ideology().
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'str_strip_whitespace': True, 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod unpack_components_and_convert_legacy(data)[source]
Unpack component objects and convert legacy ideology to IdeologicalProfile.
-
role:
SocialRole
-
ideology:
IdeologicalProfile
- property consumption_needs: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Non-negative economic value (wealth, wages, rent, GDP)', metadata=[Ge(ge=0.0)])]
Total consumption required per tick (Wealth-independent demand).
- property economic: EconomicComponent
Return economic component view (computed, not live).
- property ideological: IdeologicalComponent
Return ideological component view (computed, not live).
- property survival: SurvivalComponent
Return survival component view (computed, not live).
- property material_conditions: MaterialConditionsComponent
Return material conditions component view (computed, not live).