Package com.tnsai.coordination.trust
Interface TrustUpdateStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy for updating trust scores based on interaction outcomes.
- Since:
- 0.0.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic TrustUpdateStrategybayesian()Bayesian update strategy.static TrustUpdateStrategyema(double alpha) Exponential Moving Average strategy.doubleCalculates the new trust score.static TrustUpdateStrategySimple weighted average strategy.
-
Method Details
-
update
Calculates the new trust score.- Parameters:
currentScore- current trust score (0.0 - 1.0)outcome- the interaction outcomequality- quality of the outcome (0.0 - 1.0)totalInteractions- total number of interactions so far- Returns:
- new trust score (will be clamped to 0.0 - 1.0)
-
ema
Exponential Moving Average strategy. More recent interactions have greater weight.- Parameters:
alpha- smoothing factor (0.0 - 1.0, higher = more weight on recent)
-
bayesian
Bayesian update strategy. Uses beta distribution model (successes / total). -
weightedAverage
Simple weighted average strategy.
-