Basic Examples#
Start here if you’re new to BAM Engine. These examples demonstrate fundamental concepts and basic usage patterns.
Examples in this section:
Hello World: The simplest possible BAM Engine example - initialize, run, and visualize
Configuration: Customize simulation parameters using keyword arguments
YAML Configuration: Configure simulations using YAML files
Logging: Configure logging levels globally and per-event
BAM Operations: Comprehensive guide to the ops module for NumPy-free array operations
Type System: Using Float, Int, Bool, Agent type aliases for custom roles
Simulation Results: Comprehensive guide to SimulationResults for data collection
Baseline Scenario: Simplified baseline scenario from section 3.9.1 of the original BAM book
These examples will teach you:
How to initialize and run a basic simulation
How to configure simulation parameters via kwargs and YAML files
How to collect and visualize simulation results
How to compare different economic scenarios
How to reproduce scenarios from the BAM literature
How to use type aliases for extending BAM Engine
How to configure and use the logging system
Note: The baseline scenario example is a simplified demonstration. For full validation with target bounds and statistical annotations, run:
python -m validation.scenarios.baseline