Agent skill
agent-based-simulator
Agent-based modeling skill for simulating complex adaptive systems with heterogeneous interacting agents
Install this agent skill to your Project
npx add-skill https://github.com/a5c-ai/babysitter/tree/main/library/specializations/domains/business/decision-intelligence/skills/agent-based-simulator
Metadata
Additional technical details for this skill
- domain
- business
- category
- simulation
- priority
- lower
- specialization
- decision-intelligence
- tools libraries
-
[ "mesa", "agentpy", "pyNetLogo" ]
SKILL.md
Agent-Based Simulator
Overview
The Agent-Based Simulator skill provides capabilities for modeling complex adaptive systems through the simulation of heterogeneous, interacting agents. It enables bottom-up understanding of emergent market behaviors, customer dynamics, and competitive interactions for strategic decision support.
Capabilities
- Agent definition and behavior modeling
- Environment and spatial modeling
- Interaction rules specification
- Emergent behavior observation
- Parameter sweeping
- Ensemble simulation runs
- Visualization and animation
- Statistical analysis of outcomes
Used By Processes
- War Gaming and Competitive Response Modeling
- Market Sizing and Opportunity Assessment
- Customer Segmentation Analysis
Usage
Agent Definition
# Define customer agent
customer_agent = {
"type": "Customer",
"attributes": {
"budget": {"distribution": "normal", "mean": 1000, "std": 200},
"brand_loyalty": {"distribution": "uniform", "min": 0, "max": 1},
"price_sensitivity": {"distribution": "beta", "alpha": 2, "beta": 5},
"preferred_features": ["list of features"]
},
"behaviors": {
"purchase_decision": {
"triggers": ["need_arises", "promotion_seen"],
"evaluation": "weighted_utility",
"factors": ["price", "quality", "brand_match"]
},
"word_of_mouth": {
"probability": 0.3,
"reach": {"distribution": "poisson", "lambda": 5},
"sentiment_spread": True
},
"brand_switching": {
"threshold": 0.7,
"factors": ["satisfaction", "competitor_promotion"]
}
}
}
Environment Definition
# Define market environment
environment = {
"topology": "network", # or "grid", "continuous"
"network_type": "small_world",
"network_params": {"k": 6, "p": 0.1},
"global_properties": {
"economic_condition": {"initial": "normal", "transitions": "markov"},
"market_size": 10000,
"growth_rate": 0.02
}
}
Interaction Rules
# Define interaction rules
interactions = {
"customer_customer": {
"information_sharing": {
"probability": "based_on_relationship",
"content": ["product_experience", "price_info"]
},
"social_influence": {
"mechanism": "threshold_model",
"threshold_distribution": "normal"
}
},
"customer_company": {
"purchase": {
"frequency": "need_based",
"channel": ["online", "physical", "hybrid"]
},
"complaint": {
"trigger": "satisfaction < 0.3",
"resolution_impact": 0.5
}
},
"company_company": {
"price_competition": "cournot|bertrand|stackelberg",
"market_signaling": True
}
}
Simulation Configuration
# Simulation settings
simulation_config = {
"time_steps": 365,
"agents": {
"Customer": 5000,
"Company": 3
},
"ensemble_runs": 100,
"parameter_sweep": {
"price_sensitivity_mean": [0.3, 0.5, 0.7],
"word_of_mouth_probability": [0.1, 0.3, 0.5]
},
"data_collection": {
"agent_level": ["satisfaction", "brand_choice"],
"model_level": ["market_shares", "total_revenue", "gini_coefficient"]
}
}
Input Schema
{
"agents": {
"agent_type": {
"count": "number",
"attributes": "object",
"behaviors": "object"
}
},
"environment": {
"topology": "string",
"properties": "object"
},
"interactions": "object",
"simulation_config": {
"time_steps": "number",
"ensemble_runs": "number",
"parameter_sweep": "object",
"random_seed": "number"
}
}
Output Schema
{
"summary_statistics": {
"metric_name": {
"mean": "number",
"std": "number",
"percentiles": "object",
"time_series": ["number"]
}
},
"emergent_patterns": [
{
"pattern": "string",
"frequency": "number",
"conditions": "object"
}
],
"parameter_sweep_results": {
"parameter_combination": {
"outcomes": "object"
}
},
"agent_trajectories": "object (sample)",
"network_metrics": {
"clustering_coefficient": "number",
"average_path_length": "number",
"degree_distribution": "object"
},
"visualization_paths": ["string"]
}
Best Practices
- Start with simple agents and add complexity incrementally
- Validate agent behaviors against real-world observations
- Use ensemble runs to account for stochastic variability
- Perform sensitivity analysis on key parameters
- Document all behavioral rules and their justification
- Test for emergent behaviors under extreme conditions
- Compare results with aggregate-level data when available
Use Cases
| Use Case | Agent Types | Key Behaviors |
|---|---|---|
| Market Dynamics | Customers, Firms | Purchasing, Pricing |
| Innovation Diffusion | Adopters, Influencers | Adoption, Communication |
| Supply Chain | Suppliers, Distributors, Retailers | Ordering, Inventory |
| Opinion Formation | Citizens, Media | Influence, Information spread |
Integration Points
- Connects with System Dynamics Modeler for hybrid approaches
- Feeds into War Game Orchestrator for competitive scenarios
- Supports Scenario Narrative Generator for storyline creation
- Integrates with Monte Carlo Engine for uncertainty propagation
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-tools
Central utility skill for GSD operations. Provides config parsing, slug generation, timestamps, path operations, and orchestrates calls to other specialized skills. Acts as the unified entry point that the original gsd-tools.cjs provided via its lib/ modules (commands, config, core, init).
model-profile-resolution
Resolve model profile (quality/balanced/budget) at orchestration start and map agents to specific models. Enables cost/quality tradeoffs by selecting appropriate AI models for each agent role.
verification-suite
Plan structure validation, phase completeness checks, reference integrity verification, and artifact existence confirmation. Provides the structured verification layer ensuring GSD artifacts are well-formed and complete.
state-management
STATE.md reading, writing, and field-level updates. Provides cross-session state persistence via .planning/STATE.md with structured fields for current task, completed phases, blockers, decisions, and quick tasks.
git-integration
Git commit patterns, formats, and conventions for GSD methodology. Provides atomic commits per task, structured commit messages, planning file commits, branch management, and milestone tag operations.
frontmatter-parsing
YAML frontmatter parsing and manipulation for .planning/ documents. Provides read, write, update, query, and validation operations on frontmatter blocks in GSD markdown artifacts.
Didn't find tool you were looking for?