applyDecay method

void applyDecay({
  1. double halfLifeHours = 24.0,
})

Apply temporal decay to the memory strength.

Uses Ebbinghaus forgetting curve: S(t) = S₀ × e^(−t/τ)

Implementation

void applyDecay({double halfLifeHours = 24.0}) {
  final ageHours =
      DateTime.now().difference(timestamp).inMinutes / 60.0;
  final tau = halfLifeHours / math.log(2);
  strength = (strength * math.exp(-ageHours / tau)).clamp(0.0, 1.0);
}