Package jason.asSemantics
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Circumstance.IntentionPlace
-
Field Summary
Fields Modifier and Type Field Description protected ActionExec
A
private Event
AE
private Intention
AI
protected java.util.List<Option>
AP
private boolean
atomicIntSuspended
private java.util.Queue<Event>
E
private java.util.Queue<ActionExec>
FA
private java.util.Queue<Intention>
I
private int
intentionsWithGoalCondition
private java.util.Queue<CircumstanceListener>
listeners
private java.util.Queue<Message>
MB
private java.util.Map<java.lang.Integer,ActionExec>
PA
private java.util.Map<java.lang.String,Event>
PE
private java.util.Map<java.lang.String,Intention>
PI
protected java.util.List<Option>
RP
protected Event
SE
private static long
serialVersionUID
protected Intention
SI
protected Option
SO
java.lang.Object
syncApPlanSense
private TransitionSystem
ts
-
Constructor Summary
Constructors Constructor Description Circumstance()
-
Method Summary
Modifier and Type Method Description Event
addAchvGoal(Literal l, Intention i)
void
addEvent(Event ev)
Eventsvoid
addEventListener(CircumstanceListener el)
Listenersvoid
addExternalEv(Trigger trig)
void
addFeedbackAction(ActionExec act)
void
addMsg(Message m)
void
addPendingAction(ActionExec a)
void
addPendingEvent(java.lang.String id, Term reason, Event e)
void
addPendingIntention(java.lang.String id, Intention i)
void
addPendingIntention(java.lang.String id, Term reason, Intention i, boolean suspend)
void
addRunningIntention(Intention intention)
void
clearEvents()
void
clearPendingActions()
void
clearPendingEvents()
void
clearPendingIntentions()
void
clearRunningIntentions()
Circumstance
clone()
clone E, I, MB, PA, PI, FA, and AIvoid
create()
creates new collections for E, I, MB, PA, PI, and FAvoid
dropIntention(Intention del)
Drops an intention based on the intention id considers running, pending, ...boolean
dropPendingAction(Intention i)
removes the intention i from PA and notify listeners that the intention was droppedboolean
dropPendingIntention(Intention i)
removes the intention i from PI and notify listeners that the intention was droppedboolean
dropRunningIntention(Intention i)
removes and produces events to signal that the intention was droppedActionExec
getAction()
actionsjava.util.Iterator<Intention>
getAllIntentions()
gets all intentions (running, pending, suspended, ...)java.util.List<Option>
getApplicablePlans()
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get the agent circumstance as XMLEvent
getAtomicEvent()
java.util.Queue<Event>
getEvents()
get the queue of events (which does not include the atomic event)java.util.Iterator<Event>
getEventsPlusAtomic()
get the all events (which include the atomic event, if it exists)java.util.Queue<ActionExec>
getFeedbackActions()
java.util.Collection<CircumstanceListener>
getListeners()
java.util.Queue<Message>
getMailBox()
Messagesint
getNbRunningIntentions()
java.util.Map<java.lang.Integer,ActionExec>
getPendingActions()
pending actionjava.util.Map<java.lang.String,Event>
getPendingEvents()
pending eventsjava.util.Map<java.lang.String,Intention>
getPendingIntentions()
pending intentionsjava.util.List<Option>
getRelevantPlans()
java.util.Queue<Intention>
getRunningIntentions()
get the queue of intention (which does not include atomic intention)java.util.Iterator<Intention>
getRunningIntentionsPlusAtomic()
get all running/active intentions (which include the atomic intention, if it exists)Event
getSelectedEvent()
Intention
getSelectedIntention()
Option
getSelectedOption()
boolean
hasAtomicIntention()
boolean
hasEvent()
boolean
hasFeedbackAction()
returns true if the agent has a FA to process (actions from a suspended intention are not considered)boolean
hasIntentionWithGoalCondition()
boolean
hasListener()
boolean
hasMsg()
boolean
hasPendingAction()
boolean
hasPendingEvent()
boolean
hasPendingIntention()
boolean
hasRunningIntention()
boolean
hasRunningIntention(Intention i)
void
insertMetaEvent(Event ev)
boolean
isAtomicIntentionSuspended()
private void
readObject(java.io.ObjectInputStream inputStream)
Event
removeAtomicEvent()
remove and returns the event with atomic intention, null if noneIntention
removeAtomicIntention()
boolean
removeEvent(Event ev)
void
removeEventListener(CircumstanceListener el)
void
removeEvents(Trigger te, Unifier un)
ActionExec
removePendingAction(int intentionId)
Event
removePendingEvent(java.lang.String pendingId)
void
removePendingEvents(Trigger te, Unifier un)
Intention
removePendingIntention(int intentionId)
Intention
removePendingIntention(java.lang.String pendingId)
boolean
removeRunningIntention(Intention i)
remove intention from set Ivoid
reset()
set null for A, RP, AP, SE, SO, and SIvoid
resetAct()
void
resetDeliberate()
void
resetIntentionsWithGoalCondition()
void
resetSense()
void
resumeIntention(Intention intention, Term reason)
add the intention back to I, and also notify meta listeners that the goals are resumedvoid
setAction(ActionExec a)
void
setAtomicIntention(Intention i)
void
setTS(TransitionSystem ts)
java.lang.String
toString()
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
E
-
I
-
A
-
MB
-
RP
-
AP
-
SE
-
SO
-
SI
-
AI
-
AE
-
atomicIntSuspended
private boolean atomicIntSuspended -
PA
-
FA
-
PI
-
PE
-
listeners
-
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
-
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
-
addExternalEv
-
addEvent
Events -
insertMetaEvent
-
removeEvent
-
removeEvents
-
clearEvents
public void clearEvents() -
getEvents
get the queue of events (which does not include the atomic event) -
getEventsPlusAtomic
get the all events (which include the atomic event, if it exists) -
hasEvent
public boolean hasEvent() -
getAtomicEvent
-
removeAtomicEvent
remove and returns the event with atomic intention, null if none -
addEventListener
Listeners -
removeEventListener
-
hasListener
public boolean hasListener() -
getListeners
-
getMailBox
Messages -
addMsg
-
hasMsg
public boolean hasMsg() -
getRunningIntentions
get the queue of intention (which does not include atomic intention) -
getRunningIntentionsPlusAtomic
get all running/active intentions (which include the atomic intention, if it exists) -
getNbRunningIntentions
public int getNbRunningIntentions() -
hasRunningIntention
public boolean hasRunningIntention() -
hasRunningIntention
-
addRunningIntention
-
resumeIntention
add the intention back to I, and also notify meta listeners that the goals are resumed -
removeRunningIntention
remove intention from set I -
dropRunningIntention
removes and produces events to signal that the intention was dropped -
clearRunningIntentions
public void clearRunningIntentions() -
setAtomicIntention
-
removeAtomicIntention
-
hasAtomicIntention
public boolean hasAtomicIntention() -
isAtomicIntentionSuspended
public boolean isAtomicIntentionSuspended() -
getPendingIntentions
pending intentions -
hasPendingIntention
public boolean hasPendingIntention() -
clearPendingIntentions
public void clearPendingIntentions() -
addPendingIntention
-
addPendingIntention
-
removePendingIntention
-
removePendingIntention
-
dropPendingIntention
removes the intention i from PI and notify listeners that the intention was dropped -
getPendingEvents
pending events -
hasPendingEvent
public boolean hasPendingEvent() -
clearPendingEvents
public void clearPendingEvents() -
addPendingEvent
-
removePendingEvent
-
removePendingEvents
-
getAction
actions -
setAction
-
getApplicablePlans
-
hasFeedbackAction
public boolean hasFeedbackAction()returns true if the agent has a FA to process (actions from a suspended intention are not considered) -
getFeedbackActions
-
addFeedbackAction
-
getPendingActions
pending action -
addPendingAction
-
clearPendingActions
public void clearPendingActions() -
hasPendingAction
public boolean hasPendingAction() -
removePendingAction
-
dropPendingAction
removes the intention i from PA and notify listeners that the intention was dropped -
getAllIntentions
gets all intentions (running, pending, suspended, ...) -
dropIntention
Drops an intention based on the intention id considers running, pending, ... intentions -
getRelevantPlans
-
getSelectedEvent
-
getSelectedIntention
-
getSelectedOption
-
clone
clone E, I, MB, PA, PI, FA, and AI- Overrides:
clone
in classjava.lang.Object
-
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)get the agent circumstance as XML -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-