Package jason.stdlib
Class df_subscribe
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.df_register
jason.stdlib.df_subscribe
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".df_subscribe(service[,type])",
hint="subscribes the agent as interested in providers of referred service and, optionally, a type",
argsHint={"the service the agents is interested in","the type of the service [optional]"},
argsType={"literal","string"},
examples=".df_subscribe(\"sell(book)\"): subscribe the agent for providers of agents that sell books",
seeAlso={"jason.stdlib.df_register","jason.stdlib.df_deregister","jason.stdlib.df_search"})
public class df_subscribe
extends df_register
Internal action: .df_subscribe(S [,T])
.
Description: subscribes the agent as interested in providers of service S of type T. For each new agent providing this service, the agent will receive a message invalid input: '<'tell provider(Ag,Service)>.
Parameters:
- - service (literal): the service the agents is interested in.
- - type (string -- optional): the type of the service.
Examples:
-
.df_subscribe("sell(book)")
: subscribe the agent for providers of agents that sell books.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic InternalAction
create()
execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Methods inherited from class jason.stdlib.df_register
getService, getType
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
df_subscribe
public df_subscribe()
-
-
Method Details
-
create
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classdf_register
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classdf_register
-
execute
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 interfaceInternalAction
- Overrides:
execute
in classdf_register
- Throws:
Exception
-