Package jason.asSemantics
Class DefaultInternalAction
java.lang.Object
jason.asSemantics.DefaultInternalAction
- All Implemented Interfaces:
InternalAction,Serializable
- Direct Known Subclasses:
abolish,add,add_annot,add_nested_source,add_plan,all_names,asserta,assertz,at,atom,belief,broadcast,clone,concat,copy_term,count,create,create,create,create_agent,current_intention,date,delete,df_register,difference,drop_all_events,drop_all_intentions,drop_intention,empty,eval,fail,findall,foreach,fork,get_src_info,ground,if_then_else,include,intend,intention,internal_action,join,kill_agent,length,list,list_files,list_plans,list_rules,literal,log,loop,lower_case,member,min,my_name,namespace,namespace_get_prop,namespace_set_prop,nano_time,nth,number,perceive,plan_label,prefix,print_unifier,println,put,puts,random,range,relevant_plan,relevant_plans,relevant_rules,remove_plan,remove_source_annot,rename_apart,replace,resume,reverse,save_agent,send,set_random_seed,setof,shuffle,signal,sort,stopMAS,string,structure,sublist,substring,succeed_goal,suffix,suspend,suspended,term2string,time,type,upper_case,verbose,version,wait
Default implementation of the internal action interface (it simply returns false
for the interface methods).
Useful to create new internal actions.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn true if the internal action can be used in plans' contextprotected voidcheckArguments(Term[] args) voiddestroy()execute(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.intintTerm[]prepareArguments(Literal body, Unifier un) Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each termbooleanReturns true if the internal action (IA) should suspend the intention where the IA is called
-
Constructor Details
-
DefaultInternalAction
public DefaultInternalAction()
-
-
Method Details
-
suspendIntention
public boolean suspendIntention()Description copied from interface:InternalActionReturns true if the internal action (IA) should suspend the intention where the IA is called- Specified by:
suspendIntentionin interfaceInternalAction
-
canBeUsedInContext
public boolean canBeUsedInContext()Description copied from interface:InternalActionReturn true if the internal action can be used in plans' context- Specified by:
canBeUsedInContextin interfaceInternalAction
-
getMinArgs
public int getMinArgs() -
getMaxArgs
public int getMaxArgs() -
checkArguments
- Throws:
JasonException
-
prepareArguments
Description copied from interface:InternalActionPrepare body's terms to be used in 'execute', normally it consist of cloning and applying each term- Specified by:
prepareArgumentsin interfaceInternalAction
-
execute
Description copied from interface:InternalActionExecutes 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:
executein interfaceInternalAction- Throws:
Exception
-
destroy
- Specified by:
destroyin interfaceInternalAction- Throws:
Exception
-