Class Intention

java.lang.Object
jason.asSemantics.Intention
All Implemented Interfaces:
ToDOM, Serializable, Comparable<Intention>, Iterable<IntendedMeans>

public class Intention extends Object implements Serializable, Comparable<Intention>, Iterable<IntendedMeans>, ToDOM
Represents and Intention (a stack of IntendedMeans). The comparable sorts the intentions based on the atomic property: atomic intentions comes first.
See Also:
  • Field Details

    • EmptyInt

      public static final Intention EmptyInt
    • noReason

      public static Atom noReason
  • Constructor Details

    • Intention

      public Intention()
  • Method Details

    • setGIntention

      public void setGIntention(Intention i)
    • getGIntention

      public Intention getGIntention()
    • getId

      public int getId()
    • push

      public void push(IntendedMeans im)
    • peek

      public IntendedMeans peek()
    • pop

      public IntendedMeans pop()
    • isAtomic

      public boolean isAtomic()
    • setAtomic

      public void setAtomic(int a)
    • setNoInterestInUpdateEvents

      public void setNoInterestInUpdateEvents()
    • hasInterestInUpdateEvents

      public boolean hasInterestInUpdateEvents()
    • hasGoalCondition

      public boolean hasGoalCondition()
    • iterator

      public Iterator<IntendedMeans> iterator()
      Specified by:
      iterator in interface Iterable<IntendedMeans>
    • isFinished

      public boolean isFinished()
    • size

      public int size()
    • clearIM

      public void clearIM()
    • setSuspended

      public void setSuspended(boolean b)
      suspended intention means suspended by the internal action .suspend
    • isSuspended

      public boolean isSuspended()
    • setSuspendedReason

      public void setSuspendedReason(Term r)
    • getSuspendedReason

      public Term getSuspendedReason()
    • getIM

      public IntendedMeans getIM(IMCondition c, Unifier u)
      returns the IntendedMeans that succeeds in test c, returns null if there isn't one
    • getBottom

      public IntendedMeans getBottom()
    • getPlace

      public Circumstance.IntentionPlace getPlace()
      returns where the intention is in the interpreter data structures. It is updated by circumstance getAllIntentions.
    • setPlace

      public void setPlace(Circumstance.IntentionPlace place)
    • getStateBasedOnPlace

      public Intention.State getStateBasedOnPlace()
    • hasTrigger

      public boolean hasTrigger(Trigger g, Unifier u)
      returns true if the intention has an IM where TE = g, using u to verify equality
    • dropGoal

      public IntendedMeans dropGoal(IMCondition c, Unifier u)
      remove all IMs until the lowest IM that succeeds in test c
    • fail

      public void fail(Circumstance c)
    • findEventForFailure

      public Pair<Event,Integer> findEventForFailure(Trigger tevent, PlanLibrary pl, Circumstance c)
    • compareTo

      public int compareTo(Intention o)
      atomic intentions are grater than not atomic intentions
      Specified by:
      compareTo in interface Comparable<Intention>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Intention clone()
      Overrides:
      clone in class Object
    • copyTo

      public void copyTo(Intention i)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAsTerm

      public Structure getAsTerm()
    • getAsDOM

      public Element getAsDOM(Document document)
      get as XML
      Specified by:
      getAsDOM in interface ToDOM