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

public class DefaultInternalAction extends Object implements InternalAction, Serializable
Default implementation of the internal action interface (it simply returns false for the interface methods). Useful to create new internal actions.
See Also:
  • 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 interface InternalAction
    • 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 interface InternalAction
    • getMinArgs

      public int getMinArgs()
    • getMaxArgs

      public int getMaxArgs()
    • checkArguments

      protected void checkArguments(Term[] args) throws JasonException
      Throws:
      JasonException
    • prepareArguments

      public Term[] prepareArguments(Literal body, Unifier un)
      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 interface InternalAction
    • execute

      public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception
      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 interface InternalAction
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface InternalAction
      Throws:
      Exception