jason.asSemantics
Class DefaultInternalAction

Package class diagram package DefaultInternalAction
java.lang.Object
  extended by jason.asSemantics.DefaultInternalAction
All Implemented Interfaces:
InternalAction, java.io.Serializable
Direct Known Subclasses:
abolish, add_annot, add_nested_source, add_plan, all_names, at, atom, broadcast, clone, concat, count, create_agent, current_intention, date, delete, difference, drop_all_events, drop_all_intentions, drop_intention, eval, fail, findall, foreach, ground, if_then_else, intend, kill_agent, length, list, list_plans, literal, loop, member, min, my_name, nth, number, perceive, plan_label, prefix, println, puts, random, range, relevant_plans, remove_plan, resume, reverse, send, setof, sort, stopMAS, string, structure, sublist, substring, succeed_goal, suffix, suspend, suspended, term2string, time, wait

public class DefaultInternalAction
extends java.lang.Object
implements InternalAction, java.io.Serializable

Default implementation of the internal action interface (it simply returns false for the interface methods). Useful to create new internal actions.

See Also:
Serialized Form

Constructor Summary
DefaultInternalAction()
           
 
Method Summary
 boolean canBeUsedInContext()
          Return true if the internal action can be used in plans' context
protected  void checkArguments(Term[] args)
           
 java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args)
          Executes the internal action.
 int getMaxArgs()
           
 int getMinArgs()
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInternalAction

public DefaultInternalAction()
Method Detail

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