Ternary Consciousness Reference
API reference for the ternary consciousness model (Feature 034). For conceptual background, see Ternary Consciousness Model.
TernaryConsciousness Model
- class TernaryConsciousness
A point in the 2-simplex representing community consciousness. Three components
(r, l, f)sum to 1.0.Defined in
babylon.models.entities.consciousness.Field
Type
Default
Description
rProbability0.3
Revolutionary consciousness [0, 1]
lProbability0.6
Liberal consciousness [0, 1]
fProbability0.1
Fascist consciousness [0, 1]
contestation_storedfloat | NoneNoneLegacy contestation value (None = use Shannon entropy)
Simplex constraint:
r + l + f = 1.0(tolerance:1e-4). Violations raiseValueError.Computed properties:
Property
Type
Description
collective_identityfloatEquals
r. Backward-compatible with old scalar field.dominant_tendencyConsciousnessTendencyArgmax of
(r, l, f). Ties broken: liberal > revolutionary > fascist.ideological_contestationfloatIf
contestation_storedis set, returns that value (legacy path). Otherwise, normalized Shannon entropy:H(r, l, f) / log(3)in [0, 1].assimilation_ratiofloatf / (l + f). Position along the liberal-fascist base. Returns 0.5 whenl + f < 1e-6(fully revolutionary).Construction paths:
Native:
TernaryConsciousness(r=0.5, l=0.3, f=0.2)— direct simplex coordinates. Any leftover computed field names are stripped.Legacy:
TernaryConsciousness(collective_identity=0.5, dominant_tendency=LIBERAL, ideological_contestation=0.4)— convertsr = collective_identity, splits remaining(1 - r)betweenlandfbased ondominant_tendency, storesideological_contestationincontestation_stored.Default:
TernaryConsciousness()— setscontestation_stored=0.2and uses field defaults(r=0.3, l=0.6, f=0.1).
CommunityConsciousness Alias
CommunityConsciousness in babylon.models.entities.community is
a type alias:
CommunityConsciousness = TernaryConsciousness
All code using CommunityConsciousness transparently uses the ternary model.
SubstrateFloor
- class SubstrateFloor
Per-community-type minimum revolutionary consciousness with provenance metadata.
Defined in
babylon.models.entities.consciousness.Field
Type
Description
community_typeCommunityTypeWhich community this floor applies to
floor_valueProbabilityMinimum
rregardless of org landscape [0, 1]. Default: 0.0.confidenceProvenanceLevelData quality indicator. Default:
SYNTHETIC.data_sourceslist[str]Named data sources used for derivation
computation_methodstrHow the floor was derived from proxies
ProvenanceLevel
- class ProvenanceLevel
Data quality indicator for substrate floor computation.
StrEnumvalues:Value
Meaning
HIGHDerived from 2+ independent proxy data sources
MEDIUMDerived from 1 proxy data source
LOWEstimated from related data, not direct proxy
SYNTHETICStipulated placeholder with no data path
SUBSTRATE_FLOOR_DEFAULTS
Default substrate floors for all 14 community types. Defined in
babylon.models.entities.consciousness.
Community |
Floor |
Confidence |
Data Sources |
|---|---|---|---|
|
0.12 |
MEDIUM |
Vera incarceration rates, Chetty mobility atlas |
|
0.12 |
MEDIUM |
Vera incarceration rates, Chetty mobility atlas |
|
0.18 |
MEDIUM |
Vera incarceration rates |
|
0.08 |
LOW |
Chetty mobility atlas |
|
0.04 |
LOW |
Estimated |
|
0.06 |
LOW |
Estimated |
|
0.03 |
LOW |
Estimated |
|
0.04 |
LOW |
Estimated |
|
0.10 |
LOW |
Estimated |
|
0.0 |
HIGH |
Structural (hegemonic default) |
|
0.0 |
HIGH |
Structural (hegemonic default) |
|
0.0 |
HIGH |
Structural (lifecycle phase) |
|
0.0 |
HIGH |
Structural (lifecycle phase) |
|
0.02 |
LOW |
Estimated (generational memory) |
OrgContribution
- class OrgContribution
An organization’s weighted contribution to community consciousness. Input to
compute_ternary_consciousness().Defined in
babylon.models.entities.consciousness.Field
Type
Description
tendencyConsciousnessTendencyWhich simplex vertex this org pulls toward
membership_densityProbabilityMembers in community / community population [0, 1]
cadre_levelProbabilityOrganizational development level [0, 1]
cohesionProbabilityInternal organizational cohesion [0, 1]
compute_ternary_consciousness
- compute_ternary_consciousness(community_type, org_landscape, substrate_floor=0.0)
Compute ternary consciousness from organizational landscape.
Defined in
babylon.formulas.consciousness.- Parameters:
community_type (CommunityType) – Which community this is for (used for logging)
org_landscape (list[OrgContribution]) – Organizations operating in the community
substrate_floor (float) – Minimum
rregardless of org landscape [0, 1]
- Returns:
TernaryConsciousness with
contestation_stored = None(uses Shannon entropy for ideological_contestation)- Return type:
Algorithm:
Sum weighted contributions per tendency. Weight
w_i = membership_density * cadre_level * cohesion.Unorganized fraction
= max(0, 1 - sum(membership_densities)). Defaults to liberal (Jackson: passive acceptance is liberal hegemony).Normalize to simplex (
r + l + f = 1.0).Apply substrate floor post-normalization: if
r < floor, setr = floorand redistribute(1 - floor)tolandfproportionally.
Example:
from babylon.formulas.consciousness import compute_ternary_consciousness from babylon.models.entities.consciousness import OrgContribution from babylon.models.enums import CommunityType, ConsciousnessTendency result = compute_ternary_consciousness( community_type=CommunityType.NEW_AFRIKAN, org_landscape=[ OrgContribution( tendency=ConsciousnessTendency.REVOLUTIONARY, membership_density=0.3, cadre_level=0.8, cohesion=0.9, ), ], substrate_floor=0.12, ) print(f"r={result.r}, l={result.l}, f={result.f}")
anisotropic_observation_error
- anisotropic_observation_error(true_consciousness, *, rng_seed=None, r_noise_stddev=0.06, lf_noise_stddev=0.02)
Apply anisotropic noise modeling state surveillance asymmetry.
Defined in
babylon.bifurcation.consciousness.- Parameters:
true_consciousness (TernaryConsciousness) – Actual community consciousness position
rng_seed (int | None) – Seed for reproducible noise (None = system entropy)
r_noise_stddev (float) – Gaussian noise std for
rcomponent (default: 0.06)lf_noise_stddev (float) – Gaussian noise std for
l/fratio (default: 0.02)
- Returns:
Observed TernaryConsciousness with anisotropic noise applied, clamped to valid simplex point
- Return type:
Noise model:
Perturb
rwith Gaussian noise (stddev 0.06). Clamp to [0, 1].Compute observed
l/fratio from perturbedf / (l + f)with Gaussian noise (stddev 0.02). Clamp to [0, 1].Reconstruct
landffrom remaining budget(1 - observed_r)and perturbed ratio.
The
rcomponent has ~3x higher observation error than thel/fsplit, reflecting that revolutionary consciousness is hidden from state surveillance while liberal/fascist expression is legible.
WeightedSolidarityResult
- class WeightedSolidarityResult
Result of consciousness-weighted solidarity computation.
Defined in
babylon.bifurcation.types.Field
Type
Description
weightfloatConsciousness-weighted solidarity value (>= 0)
crisis_fragileboolTrueif effective CI < crisis-fragile threshold (0.3). Default:False.
consciousness_weighted_solidarity
- consciousness_weighted_solidarity(source_id, target_id, graph, H, community_states, defines)
Weight a solidarity edge by consciousness of connected communities.
Defined in
babylon.bifurcation.consciousness.- Parameters:
source_id (str) – Source agent node ID
target_id (str) – Target agent node ID
graph (nx.DiGraph) – The simulation DiGraph (for edge attribute access)
H (xgi.Hypergraph) – XGI hypergraph (for community membership lookup)
community_states (dict[CommunityType, CommunityState]) – Current community consciousness data
defines (BifurcationDefines) – Configurable parameters (sigmoid midpoint/steepness)
- Returns:
Weighted solidarity with crisis-fragile flag
- Return type:
Edges where the effective CI (min of both endpoints) falls below the crisis-fragile threshold (0.3) are marked
crisis_fragile = True.
CONSCIOUSNESS_DEFAULTS
Starting values for all 14 community types. Synthetic data for a Detroit
2010 test case. Defined in babylon.models.entities.community.
All values are native ternary (r, l, f) coordinates. The
ideological_contestation is computed as Shannon entropy of the
distribution.
Community |
r |
l |
f |
Dominant Tendency |
|---|---|---|---|---|
|
0.40 |
0.45 |
0.15 |
LIBERAL |
|
0.30 |
0.525 |
0.175 |
LIBERAL |
|
0.50 |
0.50 |
0.0 |
LIBERAL |
|
0.60 |
0.24 |
0.16 |
REVOLUTIONARY |
|
0.40 |
0.45 |
0.15 |
LIBERAL |
|
0.30 |
0.525 |
0.175 |
LIBERAL |
|
0.50 |
0.50 |
0.0 |
LIBERAL |
|
0.30 |
0.525 |
0.175 |
LIBERAL |
|
0.40 |
0.45 |
0.15 |
LIBERAL |
|
0.50 |
0.50 |
0.0 |
LIBERAL |
|
0.60 |
0.24 |
0.16 |
REVOLUTIONARY |
|
0.20 |
0.60 |
0.20 |
LIBERAL |
|
0.10 |
0.675 |
0.225 |
LIBERAL |
|
0.30 |
0.525 |
0.175 |
LIBERAL |
Notable patterns:
FIRST_NATIONS and INCARCERATED have the highest
r(0.6) and are the only communities with REVOLUTIONARY dominant tendency.NEW_AFRIKAN, TRANS, and UNDOCUMENTED have
f = 0.0— no fascist component, split evenly between revolutionary and liberal.ADULT has the lowest
r(0.1) — fully integrated into the labor market, atomized by liberal hegemony.
Module Cross-References
Module |
Contains |
|---|---|
|
|
|
|
|
|
|
|
|
|
See Also
Ternary Consciousness Model — Theoretical explanation
Community System Reference — Community layer API reference
Topology System Reference — Bifurcation analysis API reference