Class Circumstance

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

public class Circumstance
extends java.lang.Object
implements java.io.Serializable, ToDOM
See Also:
Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
      Constant Field Values
    • E

      private java.util.Queue<Event> E
    • I

      private java.util.Queue<Intention> I
    • A

      protected ActionExec A
    • MB

      private java.util.Queue<Message> MB
    • RP

      protected java.util.List<Option> RP
    • AP

      protected java.util.List<Option> AP
    • SE

      protected Event SE
    • SO

      protected Option SO
    • SI

      protected Intention SI
    • AI

      private Intention AI
    • AE

      private Event AE
    • atomicIntSuspended

      private boolean atomicIntSuspended
    • PA

      private java.util.Map<java.lang.Integer,​ActionExec> PA
    • FA

      private java.util.Queue<ActionExec> FA
    • PI

      private java.util.Map<java.lang.String,​Intention> PI
    • PE

      private java.util.Map<java.lang.String,​Event> PE
    • listeners

      private java.util.Queue<CircumstanceListener> listeners
    • ts

      private TransitionSystem ts
    • syncApPlanSense

      public transient java.lang.Object syncApPlanSense
    • intentionsWithGoalCondition

      private int intentionsWithGoalCondition
  • Constructor Details

    • Circumstance

      public Circumstance()
  • Method Details

    • hasIntentionWithGoalCondition

      public boolean hasIntentionWithGoalCondition()
    • resetIntentionsWithGoalCondition

      public void resetIntentionsWithGoalCondition()
    • readObject

      private void readObject​(java.io.ObjectInputStream inputStream) throws java.io.IOException, java.lang.ClassNotFoundException
      Throws:
      java.io.IOException
      java.lang.ClassNotFoundException
    • 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()
    • getEvents

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

      public java.util.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 java.util.Collection<CircumstanceListener> getListeners()
    • getMailBox

      public java.util.Queue<Message> getMailBox()
      Messages
    • addMsg

      public void addMsg​(Message m)
    • hasMsg

      public boolean hasMsg()
    • getRunningIntentions

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

      public java.util.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 java.util.Map<java.lang.String,​Intention> getPendingIntentions()
      pending intentions
    • hasPendingIntention

      public boolean hasPendingIntention()
    • clearPendingIntentions

      public void clearPendingIntentions()
    • addPendingIntention

      public void addPendingIntention​(java.lang.String id, Intention i)
    • addPendingIntention

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

      public Intention removePendingIntention​(java.lang.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 java.util.Map<java.lang.String,​Event> getPendingEvents()
      pending events
    • hasPendingEvent

      public boolean hasPendingEvent()
    • clearPendingEvents

      public void clearPendingEvents()
    • addPendingEvent

      public void addPendingEvent​(java.lang.String id, Term reason, Event e)
    • removePendingEvent

      public Event removePendingEvent​(java.lang.String pendingId)
    • removePendingEvents

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

      public ActionExec getAction()
      actions
    • setAction

      public void setAction​(ActionExec a)
    • getApplicablePlans

      public java.util.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)
    • getFeedbackActions

      public java.util.Queue<ActionExec> getFeedbackActions()
    • addFeedbackAction

      public void addFeedbackAction​(ActionExec act)
    • getPendingActions

      public java.util.Map<java.lang.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 java.util.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 java.util.List<Option> getRelevantPlans()
    • getSelectedEvent

      public Event getSelectedEvent()
    • getSelectedIntention

      public Intention getSelectedIntention()
    • getSelectedOption

      public Option getSelectedOption()
    • clone

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

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object