bdi4jade.belief

## Interface Belief<K,V>

- Type Parameters:
    `K` - the type of the belief name or key.
    `V` - the type of the belief value.
  All Superinterfaces:
    java.lang.Cloneable, jade.content.Concept, jade.content.ContentElement, MetadataElement, java.io.Serializable, jade.content.Term
  All Known Subinterfaces:
    BeliefSet<K,V>, Predicate<K>
  All Known Implementing Classes:
    AbstractBelief, AbstractBeliefSet, DerivedBelief, DerivedPredicate, PersistentBelief, TransientBelief, TransientBeliefSet, TransientPredicate

      public interface Belief<K,V>
      extends java.io.Serializable, jade.content.Concept, jade.content.ContentElement, MetadataElement, java.lang.Cloneable

  This interface represents a belief of the belief base. It has a name (or a key) and a value associate with it. It is parameterized by the types of the name/key and value. For example, a name may be an object representing a propositional formula, and the value is a boolean indicating whether the formula is true or false. It extends the `MetadataElement` interface, allowing to associate metadata with beliefs.
  Author:
    Ingrid Nunes

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBeliefBase(BeliefBase beliefBase)` Adds a belief base that contains this belief.
    `java.lang.Object` | `clone()` Clones a belief.
    `java.util.Set<BeliefBase>` | `getBeliefBases()` Returns the belief bases with which this belief is associated.
    `K` | `getName()` Returns the name of this belief.
    `V` | `getValue()` Gets the current value of the belief.
    `void` | `removeBeliefBase(BeliefBase beliefBase)` Removes a belief base that does not contain this belief anymore.
    `void` | `setValue(V value)` Sets the new value of the belief.

    - ### Methods inherited from interface bdi4jade.core.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Method Detail

    - #### addBeliefBase

          void addBeliefBase(BeliefBase beliefBase)

      Adds a belief base that contains this belief. The agent whose capability contains this belief in the belief base believes in this belief.
      Parameters:
        `beliefBase` - the belief base to be added.

    - #### clone

          java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException

      Clones a belief. This may be particularly useful to share this belief with other agents, copying the information of this belief without sharing other information, such as belief bases associated with a belief.
      Returns:
        the clone of this belief.
      Throws:
        `java.lang.CloneNotSupportedException` - if an implementation of a belief does not support clone.

    - #### getBeliefBases

          java.util.Set<BeliefBase> getBeliefBases()

      Returns the belief bases with which this belief is associated.
      Returns:
        the belief bases.

    - #### getName

          K getName()

      Returns the name of this belief.
      Returns:
        the string that is the belief name.

    - #### getValue

          V getValue()

      Gets the current value of the belief.
      Returns:
        the belief value.

    - #### removeBeliefBase

          void removeBeliefBase(BeliefBase beliefBase)

      Removes a belief base that does not contain this belief anymore. The agent whose capability does not contain this belief in the belief base does not believe in this belief anymore.
      Parameters:
        `beliefBase` - the belief base to be removed.

    - #### setValue

          void setValue(V value)

      Sets the new value of the belief.
      Parameters:
        `value` - the new value.