First simulation
Command line
python run_simulation.py --environment development --steps 1000
Results are written under simulations/ (database files, logs, and analysis output).
Experiments and analysis tools
# Parameter sweeps
python farm/core/cli.py --mode experiment --environment development --experiment-name test --iterations 3
# Visualize existing results
python farm/core/cli.py --mode visualize --db-path simulations/simulation.db
# Generate analysis reports
python farm/core/cli.py --mode analyze --db-path simulations/simulation.db
See Experiment quickstart for parameter studies.
API server
uvicorn farm.api.server:app --host 0.0.0.0 --port 5000
Use the uvicorn command directly. Running python -m farm.api.server enables reload=True, which requires an import string and exits with a warning.
Defaults:
- Port 5000
- Structured logs in
logs/application.json.logandlogs/application.log
Key endpoints:
POST /api/simulation/new— create and run a simulationGET /api/simulation/<sim_id>/step/<step>— fetch a stepGET /api/simulation/<sim_id>/analysis— run analysisGET /api/simulation/<sim_id>/export— export dataWS /ws/<client_id>— WebSocket client channel
See Deployment for production notes.
Benchmarks
python -m benchmarks.run_benchmarks --list
python -m benchmarks.run_benchmarks --spec benchmarks/specs/memory_db_baseline.yaml
See benchmarks/README.md.
Testing
pytest -q
# or
python run_tests.py