Package jason.stdlib
Class succeed_goal
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.succeed_goal
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".succeed_goal(goal)", hint="remove goals from the agent circumstance as if a plan for such goal had successfully finished", argsHint="the goals to be removed", argsType="literal", examples=".succeed_goal(go(X,3)): stops any attempt to achieve goals such as !go(1,3) as if it had already been achieved", 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.fail_goal","jason.stdlib.intention","jason.stdlib.suspend","jason.stdlib.suspended","jason.stdlib.resume"}) public class succeed_goal extends DefaultInternalAction
Internal action:
.succeed_goal(G)
.
Description: remove goals G from the agent circumstance as if a plan
for such goal had successfully finished. 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 E, PA, or PI as well.
The meta-event ^!G[state(finished)]
is produced.
Example:
-
.succeed_goal(go(X,3))
: stops any attempt to achieve goals such as!go(1,3)
as if it had already been achieved.
-
Field Summary
Fields Modifier and Type Field Description private static Term
resumeReason
-
Constructor Summary
Constructors Constructor Description succeed_goal()
-
Method Summary
Modifier and Type Method Description protected void
checkArguments(Term[] args)
void
drop(TransitionSystem ts, IMCondition c, Unifier un)
void
drop(TransitionSystem ts, Literal l, Unifier un)
(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.int
getMaxArgs()
int
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
-
Field Details
-
resumeReason
-
-
Constructor Details
-
succeed_goal
public succeed_goal()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
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 classDefaultInternalAction
- Throws:
java.lang.Exception
-
drop
- Throws:
java.lang.Exception
-
drop
- Throws:
java.lang.Exception
-
dropIntention
public int dropIntention(Intention i, IMCondition c, TransitionSystem ts, Unifier un) throws JasonException- Throws:
JasonException
-
dropInEvent
- Throws:
java.lang.Exception
-