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:

  1. FirmsDecideDesiredProduction - Set production targets based on inventory/prices

  2. FirmsDecideDesiredLabor - Calculate labor needs from production targets

  3. FirmsDecideVacancies - Determine job openings

  4. 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.planning

System function implementations

bamengine.events.production

Production-phase pricing events

Producer

Production and pricing state

Employer

Labor hiring state

Event Classes#

FirmsDecideDesiredProduction

Set production targets based on inventory levels and market position.

FirmsPlanBreakevenPrice

Calculate planning-phase breakeven price from previous period's costs.

FirmsPlanPrice

Planning-phase price adjustment based on inventory and market position.

FirmsDecideDesiredLabor

Calculate labor requirements from production targets and productivity.

FirmsDecideVacancies

Calculate number of job vacancies to post.

FirmsFireExcessWorkers

Fire workers when current labor exceeds desired labor.