FirmsDecideWageOffer#
- class bamengine.events.labor_market.FirmsDecideWageOffer[source]#
Bases:
EventFirms with vacancies post wage offers with random markup over previous offer.
Firms that have open vacancies increase their wage offers to attract workers. The wage increase is a random shock, and the final offer must satisfy the minimum wage constraint. Firms without vacancies leave their wage unchanged.
Algorithm
For each firm i:
Generate wage shock: \(\varepsilon_i \sim U(0, h_\xi)\)
If firm has vacancies (\(V_i > 0\)): - Apply markup: \(w'_i = w_{i,t-1} \times (1 + \varepsilon_i)\) - Enforce floor: \(w_i = \max(w'_i, \hat{w}_t)\)
Otherwise: \(w_i = w_{i,t-1}\) (unchanged)
Mathematical Notation
\[\begin{split}w_{i,t} = \begin{cases} \max(\hat{w}_t, w_{i,t-1} \times (1 + \varepsilon_i)) & \text{if } V_i > 0 \\ w_{i,t-1} & \text{otherwise} \end{cases}\end{split}\]where:
\(w_i\): wage offer by firm i
\(\hat{w}_t\): minimum wage at period t
\(\varepsilon_i\): wage shock \(\sim U(0, h_\xi)\)
\(h_\xi\): maximum wage growth rate parameter (config)
\(V_i\): number of vacancies at firm i
Examples
Execute this event:
>>> import bamengine as be >>> sim = be.Simulation.init(n_firms=100, seed=42) >>> event = sim.get_event("firms_decide_wage_offer") >>> event.execute(sim)
Check wage offers satisfy minimum wage:
>>> (sim.emp.wage_offer >= sim.ec.min_wage).all() True
Find firms with vacancies:
>>> import numpy as np >>> has_vacancies = sim.emp.n_vacancies > 0 >>> has_vacancies.sum() 25
Average wage offer from hiring firms:
>>> hiring_mask = sim.emp.n_vacancies > 0 >>> sim.emp.wage_offer[hiring_mask].mean() 1.15
Notes
This event must execute after FirmsDecideVacancies and AdjustMinimumWage.
Only firms with vacancies adjust their wage offers. Firms without vacancies retain their previous wage offer (though it may not be used until they post vacancies again).
The wage shock prevents firms from settling into static wage levels and introduces competition for workers.
See also
AdjustMinimumWageUpdates minimum wage floor
FirmsDecideVacanciesDetermines which firms have open positions
WorkersDecideFirmsToApplyWorkers select firms based on wage offers
bamengine.events._internal.labor_market.firms_decide_wage_offerImplementation
- 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 = 'firms_decide_wage_offer'#