Epic: #64 (AffinityEngine)
Depends on: #65 (crate scaffold)
What
Implement AffinityConfig in crates/arcane-affinity/src/config.rs:
- All fields
pub for benchmark parameter sweeps
Default impl with production-ready values
- Optional:
from_env() constructor for runtime configuration via environment variables
Key parameters
| Parameter |
Default |
Purpose |
decay_factor |
0.97 |
Exponential decay per tick (~3.3s half-life at 10 Hz) |
gc_threshold |
0.001 |
GC prune threshold |
weight_party_member |
5.0 |
Same-party interaction weight floor |
weight_guild_member |
1.0 |
Same-guild interaction weight floor |
weight_proximity_per_tick |
0.1 |
Proximity-based weight per tick |
proximity_radius |
50.0 |
World units for proximity detection |
spatial_weight |
0.2 |
Blend factor (0=pure interaction, 1=pure spatial) |
migration_threshold |
3.0 |
Min score improvement to trigger migration |
cooldown_ticks |
50 |
Post-migration cooldown |
merge_entity_threshold |
5 |
Min entities wanting to move for a Merge decision |
Acceptance criteria
- Struct with all fields and Default impl
cargo test validates default values are within expected ranges
Spec
See arcane-engine repo: in_08_04_affinity_config.md
Epic: #64 (AffinityEngine)
Depends on: #65 (crate scaffold)
What
Implement
AffinityConfigincrates/arcane-affinity/src/config.rs:pubfor benchmark parameter sweepsDefaultimpl with production-ready valuesfrom_env()constructor for runtime configuration via environment variablesKey parameters
decay_factorgc_thresholdweight_party_memberweight_guild_memberweight_proximity_per_tickproximity_radiusspatial_weightmigration_thresholdcooldown_ticksmerge_entity_thresholdAcceptance criteria
cargo testvalidates default values are within expected rangesSpec
See
arcane-enginerepo:in_08_04_affinity_config.md