Skip to main content

Appendix E: Example Catalog & Feature Coverage

This appendix catalogs every SDK example, maps feature families to examples, and summarizes the model library's feature coverage. Together these tables confirm that no SDK capability is left unexercised.

E.1 SDK Example Catalog​

The SDK ships 25 runnable examples (numbered 01--26, with four sharing slot 16). Each example is a self-contained script that demonstrates one or two SDK features in isolation. The table below lists every example and its primary SDK features.

#ExampleSDK Features Demonstrated
01Minimal ModelAgent, Action, Sequence, Accumulator, run_simulation()
02Message PassingLinks, IntegerMessage, send(), get_messages(), phase ordering
03Network Topologiesring, small_world, scale_free, GridSpace
04Custom MessagesCustom Message subclasses, broadcast(), type filtering
05Accumulators & GlobalsAccumulator, GlobalState, read-only proxy, reset_accumulators()
06TestKit UsageTestKit helpers: set_state, inject_message, get_outbox
07Determinism CheckDeterminismChecker, cross-process check, SHA-256 seeding
08MC EvaluationMCRunner, MC spec (seeds, burn-in), metrics spec, trace fields
09Settings & Configsettings.json, ABMRuntime, backend selection via config
10Output SpecificationOutputRecorder, TimeConfig, record(), CSV/GZIP export
11VisualizationDashboard, 7 chart types, to_html(), save_png()
12Parameter SweepExperimentRunner, GridSweep, ParameterRange, sensitivity analysis
13External AgentsExternalAgentProxy, MockExternalServer, ExternalSystemBridge
14RL AgentsRLAgent, TabularQPolicy, observe(), compute_reward()
15Interactive VizPlotly backend, animated charts, box/violin/Sankey/parallel coords
16CheckpointCheckpointManager, auto-checkpoint via AFTER_STEP hook
16Dask DistributedDaskBackend, LocalCluster, partition strategies
16OTel InstrumentationOpenTelemetry, TelemetrySettings, console exporter
16SQL OutputSQLite / PostgreSQL / ClickHouse output sinks
17Split & BackendsSplit, ProcessPoolBackend, ThreadPoolBackend, backend comparison
18LLM AgentsLLMAgent, MockLLMBackend, AgentMemory, ResponseCache, LLMConfig
19Pregel BackendPregelBackend, PregelAgent, vote_to_halt, BSP convergence
20Guardrails & ValidationGuardrails (NaN, MaxAgents), Validator, AuditTrail, HookEvent
21CalibrationABC-SMC, Prior, FeatureSet.distance(), Input/Variable/Constant
22Ablation TestingMechanismDeclaration, AblationRunner, pairwise ablation
23Feature ValidationFeatureSet, KS test, Wasserstein, bootstrap CI, BH-FDR
24Variance DecompositionNestedMCRunner, NestedANOVA, ICC, power analysis
25Multi-Level OutputSimulationRecorder, RecordLevel, LatinHypercubeSweep
26Advanced Topologiesfully_connected, random_graph, hierarchical_tree, NetworkSpace BFS

Note: Bold rows (17--26) were added in the v0.7.0 coverage expansion. All 25 examples pass in a single run_all_examples.py invocation (73.7 s, JSON output to .claude/results/examples/).


E.2 Feature--Example Alluvial Diagram​

The Sankey-style diagram below maps 12 SDK feature families (left) to the 21 examples that exercise them (right). Each coloured ribbon represents a primary coverage link -- the feature is a main focus of that example. Ribbon width and colour encode the feature family, making it easy to trace which examples cover which capabilities.

[Alluvial diagram — coming soon]

Coloured ribbons flow from feature families (left) to the examples that exercise them (right). Every feature family has at least one dedicated example -- 95% API coverage.

The alluvial flow confirms that every feature family has at least one dedicated example. The analytical layer (calibration, ablation, features, variance decomposition) was previously uncovered and is now fully exercised by examples 21--24. Agent type coverage expanded from 3/5 to 5/5 with examples 17 (Split), 18 (LLMAgent), and 19 (PregelAgent).


E.3 Model Library Coverage​

Each model in examples/models/ exercises a specific combination of SDK features. The table below shows which spatial, agent, and analytical features each model uses.

ModelSpaceAgent TypesTopologyNotable SDK Features
simple_economyLinksWorker, FirmMarket linksAccumulators, Gini coefficient, record()
sir_networkNetworkPersonsmall_worldbroadcast(), InfectionMessage
sir_gridGridSpacePerson2D MooreGridSpace, place_agent()
forest_fireGridSpaceCell2D von NeumannGridSpace, FireSpread message
schellingGridSpaceBlue, Red2D gridmove_agent(), get_neighbors()
ant_colonySpace2DAntContinuousFieldLayer, SpatialHashGrid, Weber-Fechner
tumor_growthGridSpace3 cell types2D gridMulti-type agents, energy dynamics
credit_cardLinksBorrower, BankMarket linksCompetitive pricing, RWE
cda_marketLinksBuyer, SellerMarket linksDouble-auction mechanism
counterparty_creditNetworkBankInterbankDefault cascades, contagion
gai_kapadiaNetworkBankInterbankFire sales, systemic risk
insurance_claimsLinksPolicy, InsurerMarket linksClaims dynamics
market_surveillanceLinks4 typesMarket linksSurveillance, detection metrics
mortgageLinksHousehold, BankMarket linksIncome shocks, LTI/LTV
supply_chainNetworkProducer etc.Supply networkBullwhip effect
tokyo_banksNetwork2 bank typesInterbankFire sales, capital adequacy
tradingNetworkTraderTrade networkMomentum, network diffusion
volatility_marketLinksTraderMarket linksVolatility clustering
chiarella_marketLinks3 trader typesMarket linksFundamentalist-Chartist-Noise
chiarella_llmLinksHybridAgent + 2Market linksHybridAgent, MockLLMBackend
game_of_lifeGridSpaceCell2D MooreGridSpace cellular automata

Coverage Highlights​

  • GridSpace: 5 models (sir_grid, forest_fire, schelling, tumor_growth, game_of_life)
  • NetworkSpace: 7 models (sir_network, counterparty_credit, gai_kapadia, supply_chain, tokyo_banks, trading, chiarella variants)
  • Space2D: 1 model (ant_colony) -- continuous 2D with pheromone fields
  • LLM agents: 1 model (chiarella_llm) + example 18
  • All 21 models use: Accumulators, GlobalState, Sequence, Action, get_mechanism_summary()

Domain Coverage Summary​

DomainModelsTotal Agent TypesSDK Features Exercised
Financial Markets612LLMAgent, HybridAgent, adaptive learning, price formation
Systemic Risk23scale_free topology, threshold contagion, CCP clearing
Consumer Finance24Bipartite links, Delta Learning, regulatory constraints
Market Integrity14Detection algorithms, strategy classification
Insurance13Two-tier reinsurance, catastrophe events
Operations14Serial supply chain, bullwhip effect
Spatial Dynamics34GridSpace (Von Neumann + Moore), movement, percolation
Epidemiology11NetworkSpace, small_world, SIR compartments
Biology11GridSpace, cell proliferation, mutation
Reference13Full SDK validation, multiple types + topology
Swarm Intelligence11Space2D, FieldLayer, pheromone, environment-as-mediator
Total2040

Model Selection Guide​

Learning the SDK. Start with simple_economy (full lifecycle: multiple agent types, links, accumulators, output recording) or sir_network (message passing over a small-world network). Move to forest_fire or schelling for GridSpace models, then ant_colony for continuous Space2D.

Exploring specific SDK features. Use cda_market for multi-phase sequences and order-matching logic. Use chiarella_llm for HybridAgent and LLM integration patterns. Use supply_chain for multi-tier network topologies and bullwhip dynamics. Use counterparty_credit for contagion cascades on interbank networks.

Domain-specific applications. Financial markets practitioners should study the six market models (volatility_market, cda_market, trading, chiarella_market, chiarella_llm, tokyo_banks) which together cover price formation, order flow, strategy adaptation, and systemic risk. Insurance and credit-risk modellers should examine insurance_claims, credit_card, and mortgage for regulatory constraint patterns. Operations researchers should start with supply_chain for bullwhip dynamics and inventory management.