Configuration

This document details all configuration items provided by AgentSociety, helping to understand all the features offered by the AgentSociety framework, including:

Complete Configuration Example

The following is a complete example that includes all major configuration items. This configuration demonstrates how to set up a complex simulation experiment with 500 citizens and 20 enterprises, including questionnaire surveys and environmental interventions:

Large Language Model Configuration Section:

  • provider: Model provider type

  • model: Model name to be used

  • api_key: API access key

  • concurrency: Number of concurrent requests

  • timeout: Request timeout time

Environment Configuration Section:

  • db.enabled: Whether to enable database

  • db.db_type: Database type

  • home_dir: Data storage directory

Map Configuration Section:

  • file_path: Map file path

Agent Configuration Section:

  • citizens: List of citizen agent configurations

  • firms: List of enterprise agent configurations

  • agent_class: Agent class name

  • number: Number of agents

Experiment Configuration Section:

  • name: Experiment name

  • workflow: List of experiment process steps, including simulation runs, environmental interventions, questionnaire surveys, etc.

  • environment: Simulation environment parameters, including start time, weather, temperature, etc.

  • logging_level: Log output level

llm:
  - provider: qwen
    model: qwen-turbo
    api_key: sk-your-qwen-key
    concurrency: 200
    timeout: 30

env:
  db:
    enabled: true
    db_type: sqlite
  home_dir: ./agentsociety_data

map:
  file_path: ./agentsociety_data/beijing.pb

agents:
  citizens:
    - agent_class: SocietyAgent
      number: 500
  firms:
    - agent_class: firm
      number: 20

exp:
  name: comprehensive_simulation
  workflow:
    - type: run
      days: 1
      ticks_per_step: 300
    - type: environment
      key: weather
      value: "下雨"
    - type: survey
      target_agent: [1, 2, 3, 4, 5]
      survey:
        id: "550e8400-e29b-41d4-a716-446655440002"
        title: "天气影响调查"
        description: "了解天气变化对日常生活的影响"
        pages:
          - name: "出行影响"
            elements:
              - name: "travel_impact"
                title: "天气变化如何影响您的出行计划?"
                type: "text"
    - type: run
      days: 1
      ticks_per_step: 300
  environment:
    start_tick: 28800
    weather: "晴天"
    temperature: "温度22°C"
    workday: true
    metric_interval: 3600

logging_level: INFO

For detailed explanations of this configuration file, please refer to the documentation of each sub-configuration page.