FirmsDecideDesiredLabor#
- class bamengine.events.planning.FirmsDecideDesiredLabor[source]#
Bases:
EventCalculate labor requirements from production targets and productivity.
Firms determine how many workers they need to achieve their desired production level, given their labor productivity (output per worker).
Algorithm
For each firm i:
\[L^d_i = \lceil Y^d_i / \phi_i \rceil\]where:
\(L^d\): desired labor (number of workers needed)
\(Y^d\): desired production (from FirmsDecideDesiredProduction)
\(\phi\): labor productivity (output per worker)
Examples
>>> import bamengine as be >>> sim = be.Simulation.init(n_firms=100, seed=42) >>> event = sim.get_event("firms_decide_desired_labor") >>> event.execute(sim) >>> sim.emp.desired_labor.sum() 500
See also
FirmsDecideDesiredProductionSet production targets
FirmsDecideVacanciesCalculate job openings
bamengine.events._internal.planning.firms_decide_desired_laborImplementation
- 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_desired_labor'#