Employer#
- class bamengine.roles.employer.Employer(desired_labor, current_labor, wage_offer, wage_bill, n_vacancies, total_funds, recv_job_apps_head, recv_job_apps, wage_shock=None)[source]#
Bases:
RoleEmployer role for firms.
Represents the labor hiring and wage state for firms. Each array index corresponds to a firm ID (0 to n_firms-1).
- Parameters:
desired_labor (
Int1D) – Target number of workers needed (based on production plans).current_labor (
Int1D) – Current number of employed workers.wage_offer (
Float1D) – Wage offered to potential workers.wage_bill (
Float1D) – Total wages paid this period (shared with Borrower role).n_vacancies (
Int1D) – Number of open positions (desired_labor - current_labor).total_funds (
Float1D) – Available funds for hiring (shared view with Borrower.total_funds).recv_job_apps_head (
Idx1D) – Queue head pointer for received job applications.recv_job_apps (
Idx2D) – Queue of job application IDs, shape (n_firms, n_households).wage_shock (
Float1D, optional) – Scratch buffer for wage shock calculations (not persisted).
Examples
Access from simulation:
>>> import bamengine as bam >>> sim = bam.Simulation.init(n_firms=100, seed=42) >>> emp = sim.emp >>> emp.wage_offer.shape (100,) >>> emp.current_labor.sum() 480
Find firms with vacancies:
>>> import numpy as np >>> has_vacancies = emp.n_vacancies > 0 >>> has_vacancies.sum() 25
Calculate labor shortage:
>>> shortage = emp.desired_labor - emp.current_labor >>> total_shortage = shortage.sum() >>> total_shortage 20
Notes
The Employer role is one of three roles assigned to firms:
Producer: production and pricing (see Producer)
Employer: labor hiring and wages
Borrower: finance and credit (see Borrower)
The total_funds and wage_bill arrays are shared with Borrower role (same underlying NumPy array) for memory efficiency and consistency.
See also
ProducerProduction role for firms
BorrowerFinancial role for firms
WorkerEmployment role for households
labor_marketLabor market logic
- desired_labor#
Target number of workers needed (based on production plans).
- current_labor#
Current number of employed workers.
- wage_offer#
Wage offered to potential new workers.
- wage_bill#
Total wages paid this period (shared with Borrower).
- n_vacancies#
Number of open positions (desired_labor - current_labor).
- __init__(desired_labor, current_labor, wage_offer, wage_bill, n_vacancies, total_funds, recv_job_apps_head, recv_job_apps, wage_shock=None)#
- name = 'Employer'#
- total_funds#
Available funds for hiring (shared view with Borrower.total_funds).
- recv_job_apps_head#
Queue head pointer for received job applications.
- recv_job_apps#
Queue of worker IDs who applied, shape
(n_firms, n_households).
- wage_shock#
Scratch buffer for wage shock calculations.