Package jason.stdlib
Class df_register
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.df_register
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
- Direct Known Subclasses:
df_deregister
,df_search
,df_subscribe
@Manual(literal=".df_register(service[,type])", hint="register the agent in the Directory Facilitator as a provider of the service and, optionally, the type", argsHint={"the service the agent is to be registered","the type of the service [optional]"}, argsType={"literal","string"}, examples={".df_register(\"sell(book)\"): register the agent as a book seller",".df_register(\"sell(book)\",\"book-trading\"): register the agent as a book seller of type \"book-trading\"",".df_register(\"expert(stocks)\",\"finantial-consultant\"): register the agent as an expert in stocks of type \"finantial-consultant\""}, seeAlso={"jason.stdlib.df_search","jason.stdlib.df_deregister","jason.stdlib.df_subscribe"}) public class df_register extends DefaultInternalAction
Internal action: .df_register(S [,T])
.
Description: register the agent in the Directory Facilitator as a provider of service S of type T (see FIPA specification). An optional second argument can be used to define the type of the service.
Parameters:
- - service (literal): the service the agent is registered.
- - type (string -- optional): the type of the service.
Examples:
-
.df_register("sell(book)")
: register the agent as a book seller. -
.df_deregister("sell(book)","book-trading")
: register the agent as a book seller of type "book-trading".
- See Also:
df_deregister
,df_search
,df_subscribe
, Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static InternalAction
singleton
-
Constructor Summary
Constructors Constructor Description df_register()
-
Method Summary
Modifier and Type Method Description static InternalAction
create()
java.lang.Object
execute(TransitionSystem ts, Unifier un, Term[] args)
Executes the internal action.int
getMaxArgs()
int
getMinArgs()
protected java.lang.String
getService(Term[] args)
protected java.lang.String
getType(Term[] args)
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
singleton
-
-
Constructor Details
-
df_register
public df_register()
-
-
Method Details
-
create
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
execute
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.ExceptionDescription 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 classDefaultInternalAction
- Throws:
java.lang.Exception
-
getService
-
getType
-