babylon.systems

Game systems for Babylon.

The core formulas implementing MLM-TW theory: - Imperial Rent calculation - Survival Calculus (P(S|A), P(S|R)) - Consciousness Drift - Unequal Exchange

For the modular System implementations, see babylon.engine.systems.

babylon.systems.calculate_imperial_rent(alpha, periphery_wages, periphery_consciousness)[source]

Calculate Imperial Rent: Φ(Wp, Ψp) = α × Wp × (1 - Ψp).

Imperial Rent is the value extracted from the periphery that flows to the core, enabling the labor aristocracy.

Parameters:
  • alpha (float) – Extraction efficiency coefficient (0 to 1)

  • periphery_wages (float) – Periphery wage share (0 to 1)

  • periphery_consciousness (float) – Periphery consciousness/resistance (0 = submissive, 1 = revolutionary)

Return type:

float

Returns:

Imperial rent value (always >= 0)

Examples

>>> calculate_imperial_rent(0.5, 0.3, 0.2)
0.12
>>> calculate_imperial_rent(1.0, 0.5, 0.0)
0.5
>>> calculate_imperial_rent(0.0, 0.5, 0.5)
0.0
>>> calculate_imperial_rent(0.8, 0.6, 1.0)  # Full consciousness = no extraction
0.0
babylon.systems.calculate_labor_aristocracy_ratio(core_wages, value_produced)[source]

Calculate labor aristocracy ratio: Wc/Vc.

When this ratio > 1, the worker receives more than they produce, with the difference coming from Imperial Rent.

Parameters:
  • core_wages (float) – Wages received by core worker

  • value_produced (float) – Value produced by core worker

Return type:

float

Returns:

Labor aristocracy ratio

Raises:

ValueError – If value_produced is zero or negative

Examples

>>> calculate_labor_aristocracy_ratio(120.0, 100.0)  # Labor aristocracy
1.2
>>> calculate_labor_aristocracy_ratio(80.0, 100.0)   # Exploited worker
0.8
>>> calculate_labor_aristocracy_ratio(100.0, 100.0)  # Fair exchange
1.0
babylon.systems.is_labor_aristocracy(core_wages, value_produced)[source]

Determine if a worker is part of the labor aristocracy.

A worker is labor aristocracy when Wc/Vc > 1, meaning they receive more in wages than the value they produce.

Parameters:
  • core_wages (float) – Wages received by core worker

  • value_produced (float) – Value produced by core worker

Return type:

bool

Returns:

True if worker is labor aristocracy

Raises:

ValueError – If value_produced is zero or negative

Examples

>>> is_labor_aristocracy(120.0, 100.0)
True
>>> is_labor_aristocracy(80.0, 100.0)
False
>>> is_labor_aristocracy(100.0, 100.0)  # Exact equality = not aristocracy
False
babylon.systems.calculate_consciousness_drift(core_wages, value_produced, current_consciousness, sensitivity_k, decay_lambda, solidarity_pressure=0.0, wage_change=0.0)[source]

Calculate consciousness drift with Fascist Bifurcation mechanic.

Base formula: dΨc/dt = k(1 - Wc/Vc) - λΨc

Extended with Fascist Bifurcation (Sprint 3.4.2b): When wages are FALLING (wage_change < 0), crisis creates “agitation energy” that channels into either: - Revolution (if solidarity_pressure > 0) - negative drift - Fascism (if solidarity_pressure = 0) - positive drift via loss aversion

This encodes the historical insight: “Agitation without solidarity produces fascism, not revolution.” (Germany 1933 vs Russia 1917)

Parameters:
  • core_wages (float) – Wages received by core worker

  • value_produced (float) – Value produced by core worker

  • current_consciousness (float) – Current consciousness level (0 to 1)

  • sensitivity_k (float) – Sensitivity coefficient for material conditions

  • decay_lambda (float) – Decay coefficient (consciousness fades without basis)

  • solidarity_pressure (float) – Sum of incoming SOLIDARITY edge strengths [0, 1+]

  • wage_change (float) – Change in wages since last tick (negative = falling)

Return type:

float

Returns:

Rate of change of consciousness (positive = revolutionary drift, negative = reactionary/fascist drift when wages fall without solidarity)

Raises:

ValueError – If value_produced is zero or negative

babylon.systems.calculate_acquiescence_probability(wealth, subsistence_threshold, steepness_k)[source]

Calculate P(S|A) = 1 / (1 + e^(-k(x - x_critical))).

Sigmoid function modeling survival through compliance. At the threshold, probability is 0.5 (coin flip).

Parameters:
  • wealth (float) – Current wealth/resources

  • subsistence_threshold (float) – Minimum needed for survival (x_critical)

  • steepness_k (float) – Steepness of survival curve

Return type:

float

Returns:

Probability of survival through acquiescence [0, 1]

Examples

>>> calculate_acquiescence_probability(100.0, 100.0, 0.1)  # At threshold
0.5
>>> p = calculate_acquiescence_probability(150.0, 100.0, 0.1)  # Above threshold
>>> p > 0.99
True
>>> p = calculate_acquiescence_probability(50.0, 100.0, 0.1)  # Below threshold
>>> p < 0.01
True
babylon.systems.calculate_revolution_probability(cohesion, repression)[source]

Calculate P(S|R) = Cohesion / (Repression + ε).

Survival through collective action depends on organization outpacing state repression.

Parameters:
  • cohesion (float) – Unity and organization level (0 to 1)

  • repression (float) – State violence capacity (0 to 1)

Return type:

float

Returns:

Probability of survival through revolution [0, 1]

Examples

>>> calculate_revolution_probability(0.8, 0.2)  # Strong org, weak state
1.0
>>> round(calculate_revolution_probability(0.2, 0.8), 2)  # Weak org, strong state
0.25
>>> calculate_revolution_probability(0.0, 0.5)  # No organization
0.0
>>> p = calculate_revolution_probability(0.5, 0.5)  # Balanced
>>> p > 0.99
True
babylon.systems.calculate_crossover_threshold(cohesion, repression, subsistence_threshold, steepness_k)[source]

Find wealth level where P(S|R) = P(S|A) (revolution becomes rational).

This is the critical point where collective action becomes a rational survival strategy.

Parameters:
  • cohesion (float) – Unity and organization level

  • repression (float) – State violence capacity

  • subsistence_threshold (float) – Subsistence threshold for acquiescence

  • steepness_k (float) – Steepness of acquiescence curve

Return type:

float

Returns:

Wealth level at crossover point

babylon.systems.apply_loss_aversion(value)[source]

Apply Kahneman-Tversky loss aversion (λ = 2.25).

Losses are perceived as 2.25x more impactful than equivalent gains. This affects decision-making under risk.

Parameters:

value (float) – Raw value change (negative = loss, positive = gain)

Return type:

float

Returns:

Perceived value after loss aversion

Examples

>>> apply_loss_aversion(100.0)  # Gains unchanged
100.0
>>> apply_loss_aversion(-100.0)  # Losses amplified
-225.0
>>> apply_loss_aversion(0.0)  # Zero unchanged
0.0
babylon.systems.calculate_exchange_ratio(periphery_labor_hours, core_labor_hours, core_wage, periphery_wage)[source]

Calculate exchange ratio: ε = (Lp/Lc) × (Wc/Wp).

The exchange ratio quantifies unequal exchange. When ε > 1, the periphery gives more value than it receives.

Parameters:
  • periphery_labor_hours (float) – Labor hours in periphery

  • core_labor_hours (float) – Labor hours in core for same product

  • core_wage (float) – Core wage rate

  • periphery_wage (float) – Periphery wage rate

Return type:

float

Returns:

Exchange ratio

Raises:

ValueError – If any denominator value is zero or negative

Examples

>>> calculate_exchange_ratio(100.0, 100.0, 20.0, 5.0)  # Equal labor, 4x wage gap
4.0
>>> calculate_exchange_ratio(200.0, 100.0, 20.0, 10.0)  # 2x labor, 2x wage
4.0
>>> calculate_exchange_ratio(100.0, 100.0, 10.0, 10.0)  # Fair exchange
1.0
babylon.systems.calculate_exploitation_rate(exchange_ratio)[source]

Convert exchange ratio to exploitation rate percentage.

ε = 2 means 100% exploitation (double value extracted). ε = 1 means 0% exploitation (fair exchange).

Parameters:

exchange_ratio (float) – The exchange ratio ε

Return type:

float

Returns:

Exploitation rate as a percentage

babylon.systems.calculate_value_transfer(production_value, exchange_ratio)[source]

Calculate value transferred from periphery to core.

Value transfer = production × (1 - 1/ε)

Parameters:
  • production_value (float) – Value of peripheral production

  • exchange_ratio (float) – The exchange ratio ε

Return type:

float

Returns:

Value transferred to core

babylon.systems.prebisch_singer_effect(initial_price, production_increase, elasticity)[source]

Calculate Prebisch-Singer effect on commodity prices.

Terms of trade decline for commodity exporters: More production → lower prices → same poverty.

Parameters:
  • initial_price (float) – Initial commodity price

  • production_increase (float) – Fractional increase in production (0.2 = 20%)

  • elasticity (float) – Price elasticity of demand (typically negative)

Return type:

float

Returns:

New price after production increase

Modules

formulas

Mathematical formulas for the Babylon simulation.