bdi4jade.goal

## Class BeliefValueGoal<K,V>

- java.lang.Object
- - bdi4jade.goal.AbstractBeliefGoal<K>
  - - bdi4jade.goal.BeliefValueGoal<K,V>

- Type Parameters:
    `K` - the type of the belief name.
    `V` - the type of the belief value.
  All Implemented Interfaces:
    BeliefGoal<K>, Goal, jade.content.Concept, jade.content.ContentElement, jade.content.Term, java.io.Serializable
  Direct Known Subclasses:
    PredicateGoal

      public class BeliefValueGoal<K,V>
      extends AbstractBeliefGoal<K>

  This class represents the goal of an agent to believe in a certain belief with an specific value, that is, the agent has a belief whose name and value are specified in this goal.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class bdi4jade.goal.AbstractBeliefGoal

      `beliefName, outputBelief`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BeliefValueGoal()` Default constructor.
    `BeliefValueGoal(K beliefName)` Creates a new BeliefValueGoal with the provided belief.
    `BeliefValueGoal(K beliefName, V value)` Creates a new BeliefValueGoal with the provided belief name and a value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `V` | `getValue()` The belief value associated with this goal.
    `int` | `hashCode()`
    `boolean` | `isAchieved(BeliefBase beliefBase)` Checks whether this goal is achieved by verifying if the provided belief has the value specified in this goal.
    `void` | `setValue(V value)` Sets the value of this goal.
    `java.lang.String` | `toString()` Returns a string representation of this goal, in the form "BeliefValueGoal: BELIEF NAME should be BELIEF VALUE".

    - ### Methods inherited from class bdi4jade.goal.AbstractBeliefGoal

      `getBeliefName, getOutputBelief, setBeliefName, setOutputBelief`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BeliefValueGoal

          public BeliefValueGoal()

      Default constructor.

    - #### BeliefValueGoal

          public BeliefValueGoal(K beliefName)

      Creates a new BeliefValueGoal with the provided belief. The value associated with this goal is initialized with null.
      Parameters:
        `beliefName` - the belief name.

    - #### BeliefValueGoal

          public BeliefValueGoal(K beliefName,
                                 V value)

      Creates a new BeliefValueGoal with the provided belief name and a value. This value represents the value that is aimed to be associated with the belief.
      Parameters:
        `beliefName` - the belief name.
        `value` - the value that is target of this goal.

  - ### Method Detail

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `AbstractBeliefGoal<K>`
      See Also:
        `Object.equals(java.lang.Object)`

    - #### getValue

          @Parameter(direction=IN)
          public V getValue()

      The belief value associated with this goal.
      Returns:
        the belief value.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractBeliefGoal<K>`
      See Also:
        `Object.hashCode()`

    - #### isAchieved

          public boolean isAchieved(BeliefBase beliefBase)

      Checks whether this goal is achieved by verifying if the provided belief has the value specified in this goal.
      Parameters:
        `beliefBase` - the belief base to be checked.
      Returns:
        true if the belief has the value specified in this goal, false otherwise.

    - #### setValue

          public void setValue(V value)

      Sets the value of this goal.
      Parameters:
        `value` - the value.

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this goal, in the form "BeliefValueGoal: BELIEF NAME should be BELIEF VALUE".
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of this belief value goal.
      See Also:
        `Object.toString()`