AdjustMinimumWage#
- class bamengine.events.labor_market.AdjustMinimumWage[source]#
Bases:
EventPeriodically update the minimum wage based on realized inflation.
The minimum wage is indexed to inflation to maintain real purchasing power. Updates occur every min_wage_rev_period periods (e.g., every 4 periods for annual revision). Only updates after sufficient price history exists.
Algorithm
Check if current period is a revision period: \((t+1) \mod \text{min\_wage\_rev\_period} = 0\)
Check if sufficient price history exists: \(t > \text{min\_wage\_rev\_period}\)
If both conditions met: - Retrieve most recent inflation rate: \(\pi_t = \text{inflation\_history}[-1]\) - Update: \(\hat{w}_t = \hat{w}_{t-1} \times (1 + \pi_t)\)
Otherwise, skip revision (\(\hat{w}_t = \hat{w}_{t-1}\))
Mathematical Notation
\[\hat{w}_t = \hat{w}_{t-1} \times (1 + \pi_t)\]where:
\(\hat{w}_t\): minimum wage at period t
\(\pi_t\): annual inflation rate
Revision occurs only when: \((t+1) \mod M = 0\), where \(M\) = min_wage_rev_period
Examples
Execute this event:
>>> import bamengine as be >>> sim = be.Simulation.init(n_firms=100, seed=42) >>> event = sim.get_event("adjust_minimum_wage") >>> event.execute(sim)
Check minimum wage after revision period:
>>> sim = be.Simulation.init(n_firms=10, seed=42, min_wage_rev_period=4) >>> initial_wage = sim.ec.min_wage >>> # Run 5 periods to trigger first revision >>> for _ in range(5): ... sim.step() >>> sim.ec.min_wage >= initial_wage # Should increase with positive inflation True
Minimum wage unchanged before revision period:
>>> sim = be.Simulation.init(n_firms=10, seed=42, min_wage_rev_period=4) >>> initial_wage = sim.ec.min_wage >>> sim.step() >>> sim.ec.min_wage == initial_wage True
Notes
This event must execute after CalcInflationRate in each period.
The revision only occurs on specific periods determined by min_wage_rev_period (e.g., if min_wage_rev_period=4, revisions occur at t=4, 8, 12, …).
The minimum wage is bidirectional: it can decrease during deflation.
See also
CalcInflationRateCalculates inflation rate used for adjustment
FirmsDecideWageOfferWage offers must satisfy minimum wage constraint
EconomyGlobal economy state with min_wage field
bamengine.events._internal.labor_market.adjust_minimum_wageImplementation
- execute(sim)[source]#
Execute the event’s logic.
Mutates simulation state in-place. This method must be implemented by all Event subclasses.
- Parameters:
sim (
Simulation) – The simulation instance containing all state and configuration.- Returns:
All mutations are in-place.
- Return type:
Examples
Implement execute in a custom event:
>>> from bamengine import event, ops >>> >>> @event ... class CustomPricingEvent: ... def execute(self, sim): ... prod = sim.get_role("Producer") ... # Apply 10% markup to all prices ... new_prices = ops.multiply(prod.price, 1.1) ... ops.assign(prod.price, new_prices)
Access configuration and RNG:
>>> @event ... class StochasticEvent: ... def execute(self, sim): ... shock = sim.config.h_rho ... random_values = sim.rng.uniform(0, shock, size=sim.n_firms) ... # Use random_values in calculations
Notes
The execute method receives full Simulation access, including: - All roles: sim.get_role(“RoleName”) or sim.prod, sim.wrk, etc. - Configuration: sim.config - RNG: sim.rng - Economy state: sim.ec
- __init__()#
- name = 'adjust_minimum_wage'#