jason.asSemantics
Interface InternalAction

Package class diagram package InternalAction
All Known Implementing Classes:
abolish, add_annot, add_nested_source, add_plan, all_names, at, atom, broadcast, concat, ConcurrentInternalAction, count, create_agent, current_intention, date, DefaultInternalAction, delete, desire, difference, drop_all_desires, drop_all_events, drop_all_intentions, drop_desire, drop_event, drop_intention, fail, fail_goal, findall, foreach, ground, if_then_else, intend, intersection, kill_agent, length, list, list_plans, literal, loop, max, member, min, my_name, nth, number, perceive, plan_label, prefix, print, println, puts, random, range, relevant_plans, remove_plan, resume, reverse, send, sort, stopMAS, string, structure, sublist, substring, succeed_goal, suffix, suspend, suspended, term2string, time, union, wait

public interface InternalAction

Common interface for all internal actions.


Method Summary
 boolean canBeUsedInContext()
          Return true if the internal action can be used in plans' context
 java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args)
          Executes the internal action.
 Term[] prepareArguments(Literal body, Unifier un)
          Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term
 boolean suspendIntention()
          Returns true if the internal action (IA) should suspend the intention where the IA is called
 

Method Detail

suspendIntention

boolean suspendIntention()
Returns true if the internal action (IA) should suspend the intention where the IA is called


canBeUsedInContext

boolean canBeUsedInContext()
Return true if the internal action can be used in plans' context


prepareArguments

Term[] prepareArguments(Literal body,
                        Unifier un)
Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term


execute

java.lang.Object execute(TransitionSystem ts,
                         Unifier un,
                         Term[] args)
                         throws java.lang.Exception
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).

Throws:
java.lang.Exception