Package jason.stdlib
Class fail_goal
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.succeed_goal
jason.stdlib.fail_goal
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".fail_goal(goal)", hint="aborts referred goals in the agent circumstance as if a plan for such goal had failed", argsHint="the goals which the achieving attempts will be aborted", argsType="literal", examples=".fail_goal(go(1,3)): aborts an attempt to achieve goals such as !go(1,3) as if a plan for it had failed, generating event -!go(1,3)", seeAlso={"jason.stdlib.intend","jason.stdlib.desire","jason.stdlib.drop_all_desires","jason.stdlib.drop_all_events","jason.stdlib.drop_all_intentions","jason.stdlib.drop_intention","jason.stdlib.drop_desire","jason.stdlib.succeed_goal","jason.stdlib.fail_goal","jason.stdlib.intention","jason.stdlib.resume","jason.stdlib.suspend","jason.stdlib.suspended"}) public class fail_goal extends succeed_goal
Internal action:
.fail_goal(G)
.
Description: aborts goals G in the agent circumstance as if a plan
for such goal had failed. An event -!G
is generated.
A literal G
is a goal if there is a triggering event +!G
in any plan within
any intention; also note that intentions can be suspended hence appearing
in sets E, PA, or PI of the agent's circumstance as well.
The meta-event ^!G[state(failed)]
is produced.
Parameters:
- - goal (literal): the goals to be aborted.
Example:
-
.fail_goal(go(1,3))
: aborts an attempt to achieve goals such as!go(1,3)
as if a plan for it had failed, the generated event is-!go(1,3)
.
-
Constructor Summary
Constructors Constructor Description fail_goal()
-
Method Summary
Modifier and Type Method Description protected void
addAnnotsToFailEvent(Event failEvent)
(package private) void
dropInEvent(TransitionSystem ts, Event e, Intention i)
int
dropIntention(Intention i, IMCondition c, TransitionSystem ts, Unifier un)
java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.Methods inherited from class jason.stdlib.succeed_goal
checkArguments, drop, drop, getMaxArgs, getMinArgs
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
fail_goal
public fail_goal()
-
-
Method Details
-
execute
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classsucceed_goal
- Throws:
java.lang.Exception
-
dropIntention
public int dropIntention(Intention i, IMCondition c, TransitionSystem ts, Unifier un) throws JasonException- Overrides:
dropIntention
in classsucceed_goal
- Throws:
JasonException
-
addAnnotsToFailEvent
-
dropInEvent
- Overrides:
dropInEvent
in classsucceed_goal
- Throws:
java.lang.Exception
-