This guide explains how simulation settings are organised, how run.py loads them, and what each major section controls. All configs are written in YAML and merged with the defaults in experiments/default.yml unless you explicitly disable merging.
python run.py <path/to/experiment.yml> calls core.utils.build_merged_config(), which:
- Loads
experiments/default.yml. - Loads your override file (YAML or JSON).
- Normalises aliases (e.g.,
scheduler→scheduler_params). - Fills in omitted seeds deterministically so subsystems stay reproducible while remaining decorrelated.
You can supply only the fields you want to override:
# experiments/my_experiment.yml
seed: 1729
simulation:
iterations: 200
population:
num_agents: 40Sets the global RNG seed. When present, run.py seeds both Python's random and NumPy, and downstream builders derive additional seeds from it.
Controls the initial morphology, lexicon templates, and phonology.
stems.count: Number of base stems.stems.template: Template key fromcore.lexicon.templates.TEMPLATES.stems.other_templates: Optional list of additional templates for diversity.affixes.count: Number of affix slots/positions.affixes.template: Template key for affix generation.affixes.explicit_list: Optional list of literal affixes; when combined withsplit_among_agents: truethe list is partitioned across agents.dialect_different_stems: How many stems differ across dialects.dialects: Number of dialect variants to seed.phonology.rules: Ordered list of rule identifiers fromcore.phonology.rule_libraryused to build the initial cascade.
Configures how individual agents behave.
adoption_policy: Chooses how agents adopt heard forms. Setmethodtobernoulli,degree,cumulative, orsemantic_router; nested params tune each policy.lexicon_update: Defines the induction/compression pipeline. Eachstepsentry names aninductionorcompressionblock with method-specific parameters.schedulecontrols how the steps cycle.contact_policy: Chooses how agents pick communication partners (broadcast,random,k_random).
See core/adoption.py, core/induction.py, and core/compression.py for available methods and parameters.
Creates the population and network topology.
num_agents: Number of agents in the simulation.utterance_length: Tokens per interaction round.network.type: Graph generator (scale_free,log_normal,erdos_renyi,complete). Additional parameters (e.g.,avg_degree) can be provided as needed.cache_params.enabled: Whentrue, initial morphologies are cached underdata/_cache_populations.cache_params.include_seed: Includes the seed in cache keys so different seeds cache separately.cache_params.dir: Where to store caches.
High-level runtime parameters.
iterations: Number of ticks.scheduler.kind:sync,async, orrandomized_async(seecore/scheduler.py).events: Time-indexed events that modify the simulation (network splits, cascade events, etc.). Each key is a tick; the value is a list of event descriptors.
Cascade events let you inject new phonological rules mid-run.
simulation:
events:
10:
- type: cascade
params:
cascade_rules: ["VoicingAssimilation"]
agent_selection: random
selection_params:
fraction: 0.3
cumulative: true
seed: 123cascade_rules: Identifiers fromcore.phonology.rule_library.agent_selection:random,component,all,degree_high, ordegree_low.selection_params: Extra arguments (e.g.,fraction,component_id).cumulative: Whether to append to the existing cascade (true) or overwrite it (false).seed: Re-seeds agent sampling for reproducibility.
Other supported events live in core/simulation.py and core/network.py (e.g., network splits/merges).
Adoption-policy events let you switch the adoption method mid-run, and optionally target only a component (after a split) or an explicit list of agent IDs.
simulation:
events:
- tick: 100
type: adoption_policy # alias: set_adoption_policy
params:
policy:
method: bernoulli
p: 0.05
novelty: 0.5
agent_selection: all
# Flat shorthand is also accepted.
- tick: 200
type: adoption_policy
params:
method: bernoulli
p: 0.1
novelty: 0.25
agent_selection: agents
selection_params:
agent_ids: [3, 7, 11]policy: Adoption policy config (must includemethod; seecore/adoption.py).agent_selection:all(default),random,component,random_within_component,degree_high,degree_low, oragents.selection_params: Extra arguments:fractionforrandom/degree_high/degree_low/random_within_componentcomponent_idforcomponent/random_within_componentagent_idsforagents
Compression-policy events let you switch the compression method mid-run, and optionally target only a component (after a split) or an explicit list of agent IDs.
simulation:
events:
- tick: 30
type: compression_policy # alias: set_compression_policy
params:
policy:
method: snap_to_shape
r: 0.2
thresh: 0.7
agent_selection: component
selection_params:
component_id: 0
- tick: 60
type: compression_policy
params:
policy:
method: drastic
thresh: 0.9
agent_selection: agents
selection_params:
agent_ids: [3, 7, 11]
compression_interval: 20policy: Compression policy config (must includemethod; seecore/compression.py).agent_selection:all(default),random,component,random_within_component,degree_high,degree_low, oragents.selection_params: Extra arguments:fractionforrandom/degree_high/degree_low/random_within_componentcomponent_idforcomponent/random_within_componentagent_idsforagents
compression_interval/compression_start: Optional overrides for how often/when compression runs for the selected agents. Whencurrent_tickis supplied internally by the simulation, a numericcompression_startvalue is interpreted as an offset from “now”.
Controls iterated learning model behaviour (optional). Set ilm.enabled: true to activate.
ticks_per_generation: Number of ticks before a handover.utterances_per_learner: Training utterances per learner.network: How to rebuild the network between generations (persistence: keep|rebuild,rebuild_type).mentorship: Mentor assignment parameters (mode,k,require_anchor).learners: Overrides for learner agents, including their own adoption and lexicon update policies.
Configures artefacts written under data/<run_name>/.
data_dir: Folder name (relative todata/) or absolute path.overwrite_output_dir: Whenfalse, runs abort if the folder exists.log_frequency: Tick interval for logging.agent_stats: Enable per-agent outputs (detailed_stats,lexicons,signatures,images).pop_stats: Toggle timeseries, morphology grids, signature prevalence, and network frames. Usefixed_scalesto pin colour scales.summary_stats: Final aggregate plots and GIFs. Nestedgifscontrols live vs end-of-run rendering.