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.

@FunctionalInterface public interface TrustUpdateStrategy
Strategy for updating trust scores based on interaction outcomes.
Since:
0.0.5
  • Method Details

    • update

      double update(double currentScore, Outcome outcome, double quality, int totalInteractions)
      Calculates the new trust score.
      Parameters:
      currentScore - current trust score (0.0 - 1.0)
      outcome - the interaction outcome
      quality - 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

      static TrustUpdateStrategy ema(double alpha)
      Exponential Moving Average strategy. More recent interactions have greater weight.
      Parameters:
      alpha - smoothing factor (0.0 - 1.0, higher = more weight on recent)
    • bayesian

      static TrustUpdateStrategy bayesian()
      Bayesian update strategy. Uses beta distribution model (successes / total).
    • weightedAverage

      static TrustUpdateStrategy weightedAverage()
      Simple weighted average strategy.