planning#
Planning events for firm production and labor decisions.
This module defines the planning phase events that execute at the start of each simulation period. Firms make forward-looking decisions about production targets and labor requirements based on current market conditions.
Event Sequence#
The default planning events execute in this order:
FirmsDecideDesiredProduction - Set production targets based on inventory/prices
FirmsDecideDesiredLabor - Calculate labor needs from production targets
FirmsDecideVacancies - Determine job openings
FirmsFireExcessWorkers - Lay off workers when labor exceeds desired
Default planning-phase pricing events (after FirmsDecideDesiredProduction):
FirmsPlanBreakevenPrice - Breakeven using previous-period costs
FirmsPlanPrice - Price adjustment with breakeven floor
These are mutually exclusive with the production-phase pricing events
(FirmsCalcBreakevenPrice, FirmsAdjustPrice) defined in
bamengine.events.production. Activate those via pricing_phase='production'.
Design Notes#
Events operate on firm roles (Producer, Employer, Borrower)
Each event wraps a system function from events._internal.planning
System functions contain the actual implementation logic
Events handle simulation state access and parameter passing
Examples
Execute planning events:
>>> import bamengine as be
>>> sim = be.Simulation.init(n_firms=100, seed=42)
>>> # Planning events run as part of default pipeline
>>> sim.step()
Execute individual planning event:
>>> event = sim.get_event("firms_decide_desired_production")
>>> event.execute(sim)
>>> sim.prod.desired_production.mean()
105.0
See also
bamengine.events._internal.planningSystem function implementations
bamengine.events.productionProduction-phase pricing events
ProducerProduction and pricing state
EmployerLabor hiring state
Event Classes#
Set production targets based on inventory levels and market position. |
|
Calculate planning-phase breakeven price from previous period's costs. |
|
Planning-phase price adjustment based on inventory and market position. |
|
Calculate labor requirements from production targets and productivity. |
|
Calculate number of job vacancies to post. |
|
Fire workers when current labor exceeds desired labor. |