Package jason.stdlib
Class df_search
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.df_register
jason.stdlib.df_search
- All Implemented Interfaces:
InternalAction
,java.io.Serializable
@Manual(literal=".df_search(service[,type],result)", hint="list of all agents providing the service and, optionally, the type", argsHint={"the service the agents are registered","the type of the service [optional]","the resulting list of agents providing the service"}, argsType={"literal","string","list"}, examples=".df_search(\"sell(book)\",L): unifies L with [bob,alice] in case these two agents have registered as book sellers", seeAlso={"jason.stdlib.df_register","jason.stdlib.df_deregister","jason.stdlib.df_subscribe"}) public class df_search extends df_register
Internal action: .df_search(S [,T] , L)
.
Description: unifies in L a list of all agents providing the service S of type T (see FIPA Directory Facilitator specification). An optional second argument can be used to define the type of the service.
Parameters:
- - service (literal): the service the agents are registered.
- - type (string -- optional): the type of the service.
- - type (list): the resultant list of agents providing the service.
Examples:
-
.df_search("sell(book)",L)
: unifies L with [bob,alice] in case these two agents have registered as book sellers.
- See Also:
df_register
,df_deregister
,df_subscribe
, Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static InternalAction
singleton
-
Constructor Summary
Constructors Constructor Description df_search()
-
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()
Methods inherited from class jason.stdlib.df_register
getService, getType
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_search
public df_search()
-
-
Method Details
-
create
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classdf_register
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classdf_register
-
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 classdf_register
- Throws:
java.lang.Exception
-