Start here for navigation; detailed guides live in this directory.
- User Guide
- Developer Guide
- IPC API Reference
- Deployment
- Monitoring & Performance
- Electron Config Explorer architecture (renderer/main, IPC)
If you are new, read the User Guide, then the Developer Guide for setup and contribution patterns.
AgentFarm is a simulation and analysis platform for agent-based modeling and reinforcement learning experiments. The sections below link deeper guides and references.
- Module Overview - High-level introduction to AgentFarm's architecture and capabilities
- Core Architecture - Deep dive into fundamental components and design patterns
- Electron Config Explorer Architecture - Electron renderer/main boundaries, IPC, and migration plan
- Usage Examples - Practical tutorials and code examples
- Configuration Guide - Comprehensive configuration system documentation (includes Electron Config Explorer compare/diff/presets/status bar)
- API Reference - Complete API documentation for all modules
- Experiment QuickStart Guide - Running parameter studies
- Agents - Agent architecture, types, and behaviors
- Perception - Sensory systems and observation processing
- State System - Agent state management and transitions
- Action System - Core action execution framework
- Action Data - Action data structures and management
- Dynamic Channel System - Flexible observation channel framework
- Custom channel implementation examples (see Usage Examples)
The observation system supports tensor-backed sparse point storage via SparsePoints for channels that are naturally sparse (e.g., allies/enemies/trajectories). This reduces Python dict overhead and improves GPU transfers.
-
Configuration (in
ObservationConfig):storage_mode:HYBRID(default) usesSparsePointsfor point-sparse channels;DENSEwrites directly to a dense tensor.sparse_backend:"scatter"(default) or"coo". Usecoowhensumreduction with many duplicates is common.default_point_reduction:"max"(default),"sum", or"overwrite".channel_reduction_overrides: per-channel overrides by channel name.
-
Reductions:
max: keep maximum per index (deterministic, good for presence maps)sum: accumulate contributions (good for intensities)overwrite: last write wins (order-dependent; not deterministic with duplicates)
-
Metrics via
AgentObservation.get_metrics():dense_bytes,sparse_points,sparse_logical_bytes,memory_reduction_percentcache_hits,cache_misses,dense_rebuilds,dense_rebuild_time_s_totalsparse_apply_calls,sparse_apply_time_s_total
Example:
config = ObservationConfig(
R=6,
sparse_backend="scatter",
default_point_reduction="max",
channel_reduction_overrides={"TRAILS": "sum"},
)
obs = AgentObservation(config)
tensor = obs.tensor()
metrics = obs.get_metrics()- Data API - Interfaces for data access and manipulation
- Data Services - Data processing and management services
- Data Retrieval - Methods for accessing simulation data
- Database Schema - Data structure and organization
- Metrics - Performance and behavior measurement systems
- Repositories - Data storage and retrieval patterns
- Health Resource Analysis - Agent health and resource utilization analysis
- Experiment Analysis - Tools for analyzing experiment results
- Genetics Analysis Module - Genetics-specific analysis groups, plots, and reports
- Deep Q Learning - Reinforcement learning implementation
- Redis Agent Memory - Distributed agent memory system
- Hyperparameter Chromosome Design - Typed, bounded hyperparameter genes and reproduction-time evolution wiring
- Experiments - Experiment design and implementation
- Experiment case studies (see Usage Examples)
Step-by-step guides for specific use cases:
- Basic simulation setup
- Custom agent implementation
- Extending observation channels
- Experiment management
- Analysis and visualization
- Analysis modules - Analysis module index (population, spatial, learning, etc.)
- Experiment Analysis - Tools for analyzing experiment results
- Genetics Analysis Module - Genetics-specific usage and API map
- Comparative and behavioral analysis APIs live under
farm/analysis/; see Usage Examples for patterns
- Experiments - Detailed experiment configurations
- Parameter sweep examples
- Comparative studies
- Replication techniques
- Complete API Reference - All classes, methods, and functions
- Module-specific API documentation
- Type hints and signatures
- Usage examples for each API
- Configuration Guide - Comprehensive configuration reference
- YAML configuration format
- Parameter validation
- Configuration management tools
- Database schema and data retrieval
- Database utilities and maintenance
- Data export and import procedures
- Simple Simulation: Load config → Create environment → Add agents → Run simulation
- Custom Agents: Extend BaseAgent → Implement custom decision logic → Register behaviors
- Extended Observations: Create ChannelHandler → Register channel → Process observations
- Parameter Studies: Define parameter ranges → Run experiment → Analyze results
- Multi-agent cooperation studies
- Resource competition dynamics
- Learning algorithm comparison
- Emergent behavior analysis
- Scalability testing
We welcome contributions to both the platform and its documentation:
- Bug Reports: Use GitHub Issues for bugs
- Feature Requests: Propose new features via GitHub Issues
- Documentation: Improve existing docs or add new guides
- Code Contributions: Submit pull requests for enhancements
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/AgentFarm.git - Create a virtual environment and install:
pip install -r requirements.txtandpip install -e . - Run tests:
pytest(from the repository root) - Submit pull request
- Use clear, concise language
- Include code examples where helpful
- Follow existing documentation structure
- Test examples to ensure they work
- Update this README when adding new documentation
- Documentation: Start with this README and the guides listed above
- Issues: Check existing GitHub Issues
- Discussions: Use GitHub Discussions for questions and general discussion
- Examples: Usage Examples, benchmark samples under
benchmarks/examples/, and tests undertests/
- Research code:
farm/research/(analysis helpers and experiment tooling) - Tutorials: Community-contributed tutorials and guides
- Case Studies: Real-world applications and results
- Enhanced visualization tools
- Distributed simulation support
- Additional agent types and behaviors
- Advanced analysis frameworks
- Integration with popular RL libraries
- Complex social dynamics modeling
- Evolutionary algorithm integration
- Multi-objective optimization
- Real-time adaptive systems
This project is part of the Dooders research initiative exploring complex adaptive systems through computational modeling.
🎓 Learning Path Recommendation:
- Start with Module Overview for high-level understanding
- Follow Usage Examples for hands-on experience
- Dive into Configuration Guide for customization
- Reference API Documentation for development
- Explore specialized guides for advanced topics
Happy simulating! 🚀