computeCoherence method
Computes the overall coherence of the current workspace.
Coherence is high when concepts are strongly related to each other.
Implementation
double computeCoherence() {
if (_buffer.length < 2) return 1.0;
final interactions = computeInteractions();
if (interactions.isEmpty) return 0.5;
final avgStrength =
interactions.values.reduce((a, b) => a + b) / interactions.length;
return avgStrength.clamp(0.0, 1.0);
}