Package jason.asSemantics
Class TransitionSystem
java.lang.Object
jason.asSemantics.TransitionSystem
- All Implemented Interfaces:
java.io.Serializable
public class TransitionSystem
extends java.lang.Object
implements java.io.Serializable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransitionSystem.State
-
Field Summary
Fields Modifier and Type Field Description private Agent
ag
private AgArch
agArch
private Circumstance
C
private java.util.List<GoalListener>
goalListeners
private IMCondition
imcondSat
private java.lang.String
kqmlReceivedFunctor
private java.util.Map<GoalListener,CircumstanceListener>
listenersMap
private java.util.logging.Logger
logger
(package private) int
nbOfGoalConditions
private int
nrcslbr
private static Plan
planBaseForEPlans
private succeed_goal
scia
private static long
serialVersionUID
private Settings
setts
private boolean
sleepingEvt
private TransitionSystem.State
stepAct
private TransitionSystem.State
stepDeliberate
private TransitionSystem.State
stepSense
private java.util.Queue<RunnableSerializable>
taskForBeginOfCycle
-
Constructor Summary
Constructors Constructor Description TransitionSystem(Agent a, Circumstance c, Settings s, AgArch ar)
-
Method Summary
Modifier and Type Method Description void
act()
void
addGoalListener(GoalListener gl)
adds an object that will be notified about events on goals (creation, suspension, ...)java.util.List<Option>
applicablePlans(java.util.List<Option> rp)
private void
applyAddIM()
private void
applyApplPl()
void
applyClrInt(Intention i)
private void
applyClrSatInt()
private void
applyExecInt()
private void
applyFindOp()
This step is new in Jason 1.1 and replaces the steps RelPl->ApplPl->SelAppl when the user does not customise selectOption.private void
applyProcAct()
private void
applyProcMsg()
private void
applyRelApplPlRule2(java.lang.String m)
generates goal deletion eventprivate void
applyRelPl()
private void
applySelAppl()
private void
applySelEv()
private void
applySelInt()
private void
applySemanticRuleAct()
private void
applySemanticRuleDeliberate()
private void
applySemanticRuleSense()
boolean
canSleep()
boolean
canSleepAct()
boolean
canSleepDeliberate()
boolean
canSleepSense()
protected void
checkHardDeadline(Event evt)
void
deliberate()
Event
findEventForFailure(Intention i, Trigger tevent)
boolean
generateGoalDeletion(Intention i, java.util.List<Term> failAnnots, Term reason)
generate a failure event for an intentionprivate boolean
generateGoalDeletionFromEvent(java.util.List<Term> failAnnots, Term reason)
Agent
getAg()
AgArch
getAgArch()
Circumstance
getC()
java.util.List<GoalListener>
getGoalListeners()
java.util.logging.Logger
getLogger()
private Option
getOption(Event evt, Plan pl, Unifier relUn)
Settings
getSettings()
AgArch
getUserAgArch()
Deprecated.use getAgArchboolean
hasGoalListener()
private void
joinRenamedVarsIntoIntentionUnifier(IntendedMeans im, Unifier values)
private Literal
prepareBodyForEvent(Literal body, Unifier u, IntendedMeans imRenamedVars)
void
reasoningCycle()
java.util.List<Option>
relevantPlans(Trigger teP, Event evt)
private void
removeActionReQueue(Intention i)
remove the top action and requeue the current intentionboolean
removeGoalListener(GoalListener gl)
private void
resumeSyncAskIntention(java.lang.String msgId, Term answerVar, Term answerValue)
void
runAtBeginOfNextCycle(RunnableSerializable r)
Schedule a task to be executed in the begin of the next reasoning cycle.void
sense()
void
setAgArch(AgArch arch)
private static void
setDefaultFailureAnnots(Event failEvent, Term body, java.util.List<Term> failAnnots)
add default error annotations (error, error_msg, code, code_src, code_line) in the failure eventvoid
setLogger(AgArch arch)
void
setLogger(java.util.logging.Logger l)
java.lang.String
toString()
void
updateEvents(Event e)
boolean
updateEvents(java.util.List<Literal>[] result, Intention focus)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
logger
private transient java.util.logging.Logger logger -
ag
-
agArch
-
C
-
setts
-
stepSense
-
stepDeliberate
-
stepAct
-
nrcslbr
private int nrcslbr -
sleepingEvt
private boolean sleepingEvt -
goalListeners
-
taskForBeginOfCycle
-
listenersMap
-
kqmlReceivedFunctor
private final java.lang.String kqmlReceivedFunctor -
planBaseForEPlans
-
scia
-
nbOfGoalConditions
int nbOfGoalConditions -
imcondSat
-
-
Constructor Details
-
TransitionSystem
-
-
Method Details
-
setLogger
-
setLogger
public void setLogger(java.util.logging.Logger l) -
addGoalListener
adds an object that will be notified about events on goals (creation, suspension, ...) -
hasGoalListener
public boolean hasGoalListener() -
getGoalListeners
-
removeGoalListener
-
applySemanticRuleSense
- Throws:
JasonException
-
applySemanticRuleDeliberate
- Throws:
JasonException
-
applySemanticRuleAct
- Throws:
JasonException
-
applyProcMsg
- Throws:
JasonException
-
resumeSyncAskIntention
private void resumeSyncAskIntention(java.lang.String msgId, Term answerVar, Term answerValue) throws JasonException- Throws:
JasonException
-
applySelEv
- Throws:
JasonException
-
applyClrSatInt
private void applyClrSatInt() -
applyRelPl
- Throws:
JasonException
-
applyApplPl
- Throws:
JasonException
-
applyRelApplPlRule2
generates goal deletion event- Throws:
JasonException
-
applySelAppl
- Throws:
JasonException
-
applyFindOp
This step is new in Jason 1.1 and replaces the steps RelPl->ApplPl->SelAppl when the user does not customise selectOption. This version does not create the RP and AP lists and thus optimise the reasoning cycle. It searches for the first option and automatically selects it.- Throws:
JasonException
- Since:
- 1.1
-
getOption
-
applyAddIM
- Throws:
JasonException
-
applyProcAct
- Throws:
JasonException
-
applySelInt
- Throws:
JasonException
-
applyExecInt
- Throws:
JasonException
-
prepareBodyForEvent
-
applyClrInt
- Throws:
JasonException
-
joinRenamedVarsIntoIntentionUnifier
-
relevantPlans
- Throws:
JasonException
-
applicablePlans
- Throws:
JasonException
-
updateEvents
-
updateEvents
-
removeActionReQueue
remove the top action and requeue the current intention -
generateGoalDeletion
public boolean generateGoalDeletion(Intention i, java.util.List<Term> failAnnots, Term reason) throws JasonExceptiongenerate a failure event for an intention- Throws:
JasonException
-
generateGoalDeletionFromEvent
private boolean generateGoalDeletionFromEvent(java.util.List<Term> failAnnots, Term reason) throws JasonException- Throws:
JasonException
-
findEventForFailure
-
setDefaultFailureAnnots
private static void setDefaultFailureAnnots(Event failEvent, Term body, java.util.List<Term> failAnnots)add default error annotations (error, error_msg, code, code_src, code_line) in the failure event -
checkHardDeadline
-
canSleep
public boolean canSleep() -
canSleepSense
public boolean canSleepSense() -
canSleepDeliberate
public boolean canSleepDeliberate() -
canSleepAct
public boolean canSleepAct() -
runAtBeginOfNextCycle
Schedule a task to be executed in the begin of the next reasoning cycle. It is used mostly to change the C only by the TS thread (e.g. by .wait) -
reasoningCycle
public void reasoningCycle() -
sense
public void sense() -
deliberate
public void deliberate() -
act
public void act() -
getAg
-
getC
-
getSettings
-
setAgArch
-
getAgArch
-
getUserAgArch
Deprecated.use getAgArch -
getLogger
public java.util.logging.Logger getLogger() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-