API Reference

This section provides detailed documentation for all AMBER classes, functions, and modules.

Core Components

Utilities

Advanced (0.4 / 0.4.1 / 0.4.3 / 0.4.4)

Quick Reference

Core Classes:

  • ambr.Model - Base class for all agent-based models

  • ambr.Agent - Individual agent with behaviors and properties

  • ambr.BaseAgent - Abstract base class for custom agents

  • ambr.BaseModel - Abstract base class for custom models

  • ambr.Population - SoA memory manager for high-performance state handling

  • ambr.RunResults - Dict-like model.run() result with attribute access

Environments:

Data Structures:

  • ambr.AgentList - List-like container for agents with additional functionality

Optimization:

Experiments:

Snapshot-view contract (0.4 / 0.4.4):

Tensor lane (0.4):

Speed lanes (0.4.1):

  • ambr.print_status() / ambr.recommend() - machine/lane status and hints

  • ambr.ArrayKernelModel - single-run CuPy/NumPy array model

  • Optional pip install 'ambr[perf]' (Numba) for CPU scatter JIT

Device placement & lanes (0.4.3 / 0.4.4):

  • ambr.Model.cpu() / ambr.Model.gpu() - Keras-style placement; step_vectorized / step_oop dispatch (GPU is vectorized-only; see GPU backend, Going faster (lanes))

  • ambr.Model.approve_fast_path() / ambr.Model.revoke_fast_path_approval() - opt-in private GPU loop with caller-supplied evidence label

  • ambr.EXECUTION_DEVICES / EXECUTION_MODES / ExecutionConfig - placement constants (package exports)

GPU & calibration (0.4):

  • ambr.gpu.get_array_module() - Resolve the CuPy/NumPy array module

  • ambr.GPUEnsembleRunner - Batched (B × N) ensemble runner (NumPy fallback in CI)

  • ambr.BatchedWellMixedSIR - Reference well-mixed SIR batched model

  • ambr.smac_batch_calibrate() - SMAC calibration over a batched ensemble