Package jason.stdlib

Class desire

java.lang.Object
All Implemented Interfaces:
InternalAction, java.io.Serializable

@Manual(literal=".desire(desire)",
        hint="checks whether the argument is a desire",
        argsHint="the desire to be checked if it is present",
        argsType="literal",
        examples=".desire(go(1,3)): true if go(1,3) is a desire of the agent",
        seeAlso={"jason.stdlib.intend","jason.stdlib.drop_all_desires","jason.stdlib.drop_all_events","jason.stdlib.drop_all_intentions","jason.stdlib.drop_event","jason.stdlib.drop_intention","jason.stdlib.drop_desire","jason.stdlib.succeed_goal","jason.stdlib.fail_goal","jason.stdlib.intention","jason.stdlib.resume","jason.stdlib.suspend","jason.stdlib.suspended"})
public class desire
extends intend

Internal action: .desire(D, [ I ]).

Description: checks whether D is a desire: D is a desire either if there is an event with +!D as triggering event or it is a goal in one of the agent's intentions I.

Example:

  • .desire(go(1,3)): true if go(1,3) is a desire of the agent.
  • .desire(go(1,3), I): as above and I unifies with the intention that contains the desire. I is the identification of the intention. The internal action .intention can be used to further inspect the state of the intention.
See Also:
intend, drop_all_desires, drop_all_events, drop_all_intentions, drop_intention, drop_desire, succeed_goal, fail_goal, intention, suspend, suspended, resume, Serialized Form
  • Constructor Details

    • desire

      public desire()
  • Method Details

    • execute

      public java.lang.Object execute​(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.Exception
      Description copied from interface: InternalAction
      Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action).
      Specified by:
      execute in interface InternalAction
      Overrides:
      execute in class intend
      Throws:
      java.lang.Exception
    • allDesires

      public static java.util.Iterator<Unifier> allDesires​(Circumstance C, Literal l, Term intID, Unifier un)