Package astra.core
Class Intention
java.lang.Object
astra.core.Intention
public class Intention extends Object
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddBelief(Predicate belief)voidaddEvent(Event event)booleanaddGoal(Goal goal)voidaddGoals(Queue<Formula> queue, Goal goal)voidaddScopedBelief(String scope, Predicate belief)booleanaddScopedGoal(String scope, Goal goal)voidaddSubGoal(Event event, Rule rule, Map<Integer,Term> bindings, RuleExecutor parent)voidapplyActionParams()Map<Integer,Term>bindings()booleancheckEvent(Event event)voiddone()Used by DONE statement to drop the currently active g-rule (or goal if no g-rule used)voiddropPromise(Agent.Promise promise)voiddumpStack()<T> Tevaluate(Term term)booleanexecute()RuleExecutorexecutor()voidfailed(String reason)voidfailed(String reason, Throwable exception)StringfailureReason()StringgenerateIntentionTree()ModulegetModule(String classname, String key)StatementHandlergetNextStatement()TermgetValue(Variable term)booleanhandleEvent(Event event, Agent agent)booleanhasLock(String token, Intention context)booleanisActive()booleanisDone()booleanisFailed()booleanisGoalCompleted()booleanisProcessing()booleanisRecovering()booleanisSuspended()voidmakePromise(Agent.Promise promise)Stringname()voidnotifyDone(String message)voidnotifyDone(String message, Throwable exception)voidprintStackTrace()Map<Integer,Term>query(Formula formula)List<Map<Integer,Term>>queryAll(Formula formula)voidreleaseLock(String token, Intention context)voidremoveBelief(Predicate belief)voidremoveScopedBelief(String scope, Predicate belief)booleanrequestLock(String token, Intention context)voidresetActionParams()voidresume()booleanreviseGoals()booleanrollback()Rulerule()voidschedule(Task task)booleanstartFunction(Predicate function)booleanstopFunction()voidsuspend()StringtoString()booleantrace()voidunrequestLock(String token, Intention context)booleanupdateVariable(Variable term, Term logic)Moves down through the ruleexecutor stack looking for a ruleexecutor that has the variable being updated...
-
Field Details
-
Constructor Details
-
Method Details
-
execute
public boolean execute() -
getModule
-
evaluate
-
getValue
-
addSubGoal
-
updateVariable
Moves down through the ruleexecutor stack looking for a ruleexecutor that has the variable being updated...- Parameters:
term- the variable to be updatedlogic- the new value to be associated with the variable- Returns:
- true if it was updated, false otherwise
-
toString
-
failed
-
failed
-
isFailed
public boolean isFailed() -
printStackTrace
public void printStackTrace() -
rollback
public boolean rollback() -
addBelief
-
removeBelief
-
suspend
public void suspend() -
isSuspended
public boolean isSuspended() -
isRecovering
public boolean isRecovering() -
resume
public void resume() -
resetActionParams
public void resetActionParams() -
applyActionParams
public void applyActionParams() -
dumpStack
public void dumpStack() -
generateIntentionTree
-
addGoal
-
addScopedGoal
-
notifyDone
-
notifyDone
-
schedule
-
name
-
query
-
queryAll
-
startFunction
-
stopFunction
public boolean stopFunction() -
getNextStatement
-
addEvent
-
hasLock
-
requestLock
-
releaseLock
-
unrequestLock
-
addScopedBelief
-
removeScopedBelief
-
failureReason
-
makePromise
-
dropPromise
-
handleEvent
-
rule
-
isGoalCompleted
public boolean isGoalCompleted() -
done
public void done()Used by DONE statement to drop the currently active g-rule (or goal if no g-rule used) -
isActive
public boolean isActive() -
checkEvent
-
bindings
-
addGoals
-
reviseGoals
public boolean reviseGoals() -
executor
-
trace
public boolean trace() -
isDone
public boolean isDone() -
isProcessing
public boolean isProcessing()
-