Interface InternalAction

All Known Implementing Classes:
abolish, add, add, add_all, add_all, add_annot, add_nested_source, add_plan, all_names, asserta, assertz, at, atom, belief, broadcast, clear, clear, clear, clone, concat, ConcurrentInternalAction, copy, copy, copy, copy_term, count, create, create, create, create_agent, current_intention, date, DefaultInternalAction, delete, desire, df_deregister, df_register, df_search, df_subscribe, difference, difference, done, drop_all_desires, drop_all_events, drop_all_intentions, drop_desire, drop_event, drop_future_intention, drop_intention, empty, eval, fail, fail_goal, findall, foreach, fork, get, get_src_info, ground, head, if_then_else, include, intend, intention, internal_action, intersection, intersection, join, key, kill_agent, length, list, list_files, list_plans, list_rules, literal, log, loop, lower_case, max, member, min, my_name, namespace, namespace_get_prop, namespace_set_prop, nano_time, nth, number, perceive, plan_label, prefix, print, print_unifier, printf, println, put, puts, random, range, relevant_plan, relevant_plans, relevant_rules, remove, remove, remove, 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, to_list, to_list, type, union, union, upper_case, value, verbose, version, wait

public interface InternalAction
Common interface for all internal actions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if the internal action can be used in plans' context
    void
     
    Executes the internal action.
    Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term
    boolean
    Returns true if the internal action (IA) should suspend the intention where the IA is called
  • Method Details

    • 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

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

      void destroy() throws Exception
      Throws:
      Exception