Class Circumstance

java.lang.Object
jason.asSemantics.Circumstance
All Implemented Interfaces:
ToDOM, Serializable

public class Circumstance extends Object implements Serializable, ToDOM
See Also:
  • Field Details

  • Constructor Details

    • Circumstance

      public Circumstance()
  • Method Details

    • hasIntentionWithGoalCondition

      public boolean hasIntentionWithGoalCondition()
    • resetIntentionsWithGoalCondition

      public void resetIntentionsWithGoalCondition()
    • setTS

      public void setTS(TransitionSystem ts)
    • create

      public void create()
      creates new collections for E, I, MB, PA, PI, and FA
    • reset

      public void reset()
      set null for A, RP, AP, SE, SO, and SI
    • resetSense

      public void resetSense()
    • resetDeliberate

      public void resetDeliberate()
    • resetAct

      public void resetAct()
    • addAchvGoal

      public Event addAchvGoal(Literal l, Intention i)
    • addExternalEv

      public void addExternalEv(Trigger trig)
    • addEvent

      public void addEvent(Event ev)
      Events
    • insertMetaEvent

      public void insertMetaEvent(Event ev)
    • removeEvent

      public boolean removeEvent(Event ev)
    • removeEvents

      public void removeEvents(Trigger te, Unifier un)
    • clearEvents

      public void clearEvents()
    • clearEvents

      public void clearEvents(boolean onlyGoals)
    • getEvents

      public Queue<Event> getEvents()
      get the queue of events (which does not include the atomic event)
    • getEventsPlusAtomic

      public Iterator<Event> getEventsPlusAtomic()
      get the all events (which include the atomic event, if it exists)
    • hasEvent

      public boolean hasEvent()
    • getAtomicEvent

      public Event getAtomicEvent()
    • removeAtomicEvent

      public Event removeAtomicEvent()
      remove and returns the event with atomic intention, null if none
    • addEventListener

      public void addEventListener(CircumstanceListener el)
      Listeners
    • removeEventListener

      public void removeEventListener(CircumstanceListener el)
    • hasListener

      public boolean hasListener()
    • getListeners

      public Collection<CircumstanceListener> getListeners()
    • getMailBox

      public Queue<Message> getMailBox()
      Messages
    • addMsg

      public void addMsg(Message m)
    • hasMsg

      public boolean hasMsg()
    • getRunningIntentions

      public Queue<Intention> getRunningIntentions()
      get the queue of intention (which does not include atomic intention)
    • getRunningIntentionsPlusAtomic

      public Iterator<Intention> getRunningIntentionsPlusAtomic()
      get all running/active intentions (which include the atomic intention, if it exists)
    • getNbRunningIntentions

      public int getNbRunningIntentions()
    • hasRunningIntention

      public boolean hasRunningIntention()
    • hasRunningIntention

      public boolean hasRunningIntention(Intention i)
    • addRunningIntention

      public void addRunningIntention(Intention intention)
    • resumeIntention

      public void resumeIntention(Intention intention, Term reason)
      add the intention back to I, and also notify meta listeners that the goals are resumed
    • removeRunningIntention

      public boolean removeRunningIntention(Intention i)
      remove intention from set I
    • dropRunningIntention

      public boolean dropRunningIntention(Intention i)
      removes and produces events to signal that the intention was dropped
    • clearRunningIntentions

      public void clearRunningIntentions()
    • setAtomicIntention

      public void setAtomicIntention(Intention i)
    • removeAtomicIntention

      public Intention removeAtomicIntention()
    • hasAtomicIntention

      public boolean hasAtomicIntention()
    • isAtomicIntentionSuspended

      public boolean isAtomicIntentionSuspended()
    • getPendingIntentions

      public Map<String,Intention> getPendingIntentions()
      pending intentions
    • getPendingIntentionKey

      public String getPendingIntentionKey(Intention i)
    • hasPendingIntention

      public boolean hasPendingIntention()
    • clearPendingIntentions

      public void clearPendingIntentions()
    • addPendingIntention

      public void addPendingIntention(String id, Intention i)
    • addPendingIntention

      public void addPendingIntention(String id, Term reason, Intention i, boolean suspend)
    • removePendingIntention

      public Intention removePendingIntention(String pendingId)
    • removePendingIntention

      public Intention removePendingIntention(int intentionId)
    • dropPendingIntention

      public boolean dropPendingIntention(Intention i)
      removes the intention i from PI and notify listeners that the intention was dropped
    • getPendingEvents

      public Map<String,Event> getPendingEvents()
      pending events
    • hasPendingEvent

      public boolean hasPendingEvent()
    • clearPendingEvents

      public void clearPendingEvents()
    • addPendingEvent

      public void addPendingEvent(String id, Term reason, Event e)
    • removePendingEvent

      public Event removePendingEvent(String pendingId)
    • removePendingEvents

      public void removePendingEvents(Trigger te, Unifier un)
    • getAction

      public ActionExec getAction()
      actions
    • setAction

      public void setAction(ActionExec a)
    • getApplicablePlans

      public List<Option> getApplicablePlans()
    • hasFeedbackAction

      public boolean hasFeedbackAction()
      returns true if the agent has a FA to process (actions from a suspended intention are not considered)
    • getFALock

      public Lock getFALock()
    • getFeedbackActions

      public Queue<ActionExec> getFeedbackActions()
    • addFeedbackAction

      public void addFeedbackAction(ActionExec act)
    • getPendingActions

      public Map<Integer,ActionExec> getPendingActions()
      pending action
    • addPendingAction

      public void addPendingAction(ActionExec a)
    • clearPendingActions

      public void clearPendingActions()
    • hasPendingAction

      public boolean hasPendingAction()
    • removePendingAction

      public ActionExec removePendingAction(int intentionId)
    • dropPendingAction

      public boolean dropPendingAction(Intention i)
      removes the intention i from PA and notify listeners that the intention was dropped
    • getAllIntentions

      public Iterator<Intention> getAllIntentions()
      gets all intentions (running, pending, suspended, ...)
    • dropIntention

      public void dropIntention(Intention del)
      Drops an intention based on the intention id considers running, pending, ... intentions
    • getRelevantPlans

      public List<Option> getRelevantPlans()
    • getSelectedEvent

      public Event getSelectedEvent()
    • getSelectedIntention

      public Intention getSelectedIntention()
    • getSelectedOption

      public Option getSelectedOption()
    • setLastDeed

      protected void setLastDeed(PlanBody d)
    • getLastDeed

      public PlanBody getLastDeed()
    • clone

      public Circumstance clone()
      clone E, I, MB, PA, PI, FA, and AI
      Overrides:
      clone in class Object
    • getAsDOM

      public Element getAsDOM(Document document)
      get the agent circumstance as XML
      Specified by:
      getAsDOM in interface ToDOM
    • toString

      public String toString()
      Overrides:
      toString in class Object