Interface BeliefRevisionStrategy

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 BeliefRevisionStrategy
Strategy interface for handling conflicting beliefs.

When a new belief is added that conflicts with existing beliefs, this strategy determines how to resolve the conflict.

Built-in Strategies

Usage Example


 agent.setBeliefRevisionStrategy(BeliefRevisionStrategy.PRIORITIZE_HIGHER_CONFIDENCE);
 agent.addBelief(new Belief("Weather is sunny", 0.9, "weather-api"));
 agent.addBelief(new Belief("Weather is rainy", 0.7, "user"));
 // Only "Weather is sunny" remains (higher confidence)
 
See Also:
  • Field Details

    • PRIORITIZE_NEWER

      static final BeliefRevisionStrategy PRIORITIZE_NEWER
      Strategy that always accepts the newer belief, removing conflicting ones.
    • PRIORITIZE_HIGHER_CONFIDENCE

      static final BeliefRevisionStrategy PRIORITIZE_HIGHER_CONFIDENCE
      Strategy that keeps the belief with higher confidence.
    • KEEP_BOTH

      static final BeliefRevisionStrategy KEEP_BOTH
      Strategy that keeps both beliefs (no conflict resolution).
    • REJECT_CONFLICTS

      static final BeliefRevisionStrategy REJECT_CONFLICTS
      Strategy that rejects incoming beliefs if they conflict.
    • DEFAULT

      static final BeliefRevisionStrategy DEFAULT
      Default strategy: prioritize newer beliefs.
  • Method Details

    • revise

      List<Belief> revise(List<Belief> existing, Belief incoming)
      Revises the belief set when a new belief is added.
      Parameters:
      existing - the current list of beliefs (mutable)
      incoming - the new belief being added
      Returns:
      the revised list of beliefs