jason.stdlib
Class send

Package class diagram package send
java.lang.Object
  extended by jason.asSemantics.DefaultInternalAction
      extended by jason.stdlib.send
All Implemented Interfaces:
InternalAction, java.io.Serializable

public class send
extends DefaultInternalAction

Internal action: .send.

Description: sends a message to an agent.

Parameters:

Messages with an ask illocutionary force can optionally have arguments 3 and 4. In case they are given, .send suspends the intention until an answer is received and unified with arg[3], or the message request times out as specified by arg[4]. Otherwise, the intention is not suspended and the answer (which is a tell message) produces a belief addition event as usual.

Examples (suppose that agent jomi is sending the messages):

See Also:
broadcast, my_name, Serialized Form

Constructor Summary
send()
           
 
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()
           
 boolean suspendIntention()
          Returns true if the internal action (IA) should suspend the intention where the IA is called
 
Methods inherited from class jason.asSemantics.DefaultInternalAction
prepareArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

send

public send()
Method Detail

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
Overrides:
canBeUsedInContext in class DefaultInternalAction

getMinArgs

public int getMinArgs()
Overrides:
getMinArgs in class DefaultInternalAction

getMaxArgs

public int getMaxArgs()
Overrides:
getMaxArgs in class DefaultInternalAction

checkArguments

protected void checkArguments(Term[] args)
                       throws JasonException
Overrides:
checkArguments in class DefaultInternalAction
Throws:
JasonException

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
Overrides:
execute in class DefaultInternalAction
Throws:
java.lang.Exception

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
Overrides:
suspendIntention in class DefaultInternalAction