Skip to content

Implement AffinityConfig with defaults and env-var loading #68

@rebelmachina

Description

@rebelmachina

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions