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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return true if the internal action can be used in plans' contextprotected void
checkArguments
(Term[] args) void
destroy()
execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Term[]
prepareArguments
(Literal body, Unifier un) Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each termboolean
Returns 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:InternalAction
Returns true if the internal action (IA) should suspend the intention where the IA is called- Specified by:
suspendIntention
in interfaceInternalAction
-
canBeUsedInContext
public boolean canBeUsedInContext()Description copied from interface:InternalAction
Return true if the internal action can be used in plans' context- Specified by:
canBeUsedInContext
in interfaceInternalAction
-
getMinArgs
public int getMinArgs() -
getMaxArgs
public int getMaxArgs() -
checkArguments
- Throws:
JasonException
-
prepareArguments
Description copied from interface:InternalAction
Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term- Specified by:
prepareArguments
in interfaceInternalAction
-
execute
Description 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
- Throws:
Exception
-
destroy
- Specified by:
destroy
in interfaceInternalAction
- Throws:
Exception
-