Package jason.runtime
Interface RuntimeServices
- All Superinterfaces:
Remote
- All Known Implementing Classes:
BaseRuntimeServices,DelegatedRuntimeServices,JadeRuntimeServices,LocalRuntimeServices
This interface is implemented by the infrastructure
(Jade/Local/...) to provide concrete runtime services.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidClones an agent and starts itcreateAgent(String agName, String agSource, String agClass, List<String> archClasses, ClassParameters bbPars, Settings stts, Agent father) Creates a new agent with agName from source agSource, using agClass as agent class (default value is "jason.asSemantics.Agent"), archClasses as agent architecture classes, bbPars as the belief base class (default value is "DefaultBeliefBase"), stts as Settings (default value is new Settings()), and father is the agent creating this agent (null is none).default voiddfDeRegister(String agName, String service, String type) default voiddfRegister(String agName, String service, String type) default Collection<String> default voiddfSubscribe(String agName, String service, String type) Returns a set of all agents' namedefault AgentgetAgentSnapshot(String agName) gets a copy of some agent (BB, PL, ...)intGets the number of agents in the MAS.getAgStatus(String agName) default Collection<String> getDF()default StringgetNewAgentName(String baseName) getWP()booleanbooleanKills the agent named agName as a requested by byAg.default Stringloads some ASL code into some agent, if replace is true, the previous plans from the sourceID will be removeddefault voidregisterDefaultAgArch(String agArch) register a class to be included as new agents archsdefault StringrunAsAgent(String agName, String code) agent agName executes the code (in a new intention)voidstartAgent(String agName) starts an agent (e.g.default voidstopMAS()voidstopMAS(int deadline, boolean stopJVM, int exitValue) Stops all MAS (the agents, the environment, the controller, ...)
-
Method Details
-
getMASName
- Throws:
RemoteException
-
createAgent
String createAgent(String agName, String agSource, String agClass, List<String> archClasses, ClassParameters bbPars, Settings stts, Agent father) throws Exception, RemoteException Creates a new agent with agName from source agSource, using agClass as agent class (default value is "jason.asSemantics.Agent"), archClasses as agent architecture classes, bbPars as the belief base class (default value is "DefaultBeliefBase"), stts as Settings (default value is new Settings()), and father is the agent creating this agent (null is none). if no archClasses is informed (null value), if fathers is informed use father's ag archs else use default ag archs (see registerDefaultAgArch)Example: createAgent("bob", "bob.asl", "mypkg.MyAgent", null, null, null); Returns the name of the agent
- Throws:
ExceptionRemoteException
-
getNewAgentName
- Throws:
RemoteException
-
registerDefaultAgArch
register a class to be included as new agents archs- Throws:
RemoteException
-
getDefaultAgArchs
- Throws:
RemoteException
-
startAgent
starts an agent (e.g. create thread for it)- Throws:
RemoteException
-
clone
default void clone(Agent source, List<String> archClasses, String agName) throws RemoteException, JasonException Clones an agent and starts it- Parameters:
source- : the agent used as source for beliefs, plans, ...archClasses- : agent architectures that will be usedagName- : the name of the clone return the agent arch created- Throws:
JasonExceptionRemoteException
-
killAgent
Kills the agent named agName as a requested by byAg. Agent.stopAg() method is called before the agent is removed.- Throws:
RemoteException
-
getAgentsName
Returns a set of all agents' name- Throws:
RemoteException
-
getAgentsQty
Gets the number of agents in the MAS.- Throws:
RemoteException
-
isRunning
- Throws:
RemoteException
-
getAgStatus
- Throws:
RemoteException
-
getAgentSnapshot
gets a copy of some agent (BB, PL, ...)- Throws:
RemoteException
-
loadASL
default String loadASL(String agName, String code, String sourceId, boolean replace) throws RemoteException loads some ASL code into some agent, if replace is true, the previous plans from the sourceID will be removed- Throws:
RemoteException
-
runAsAgent
agent agName executes the code (in a new intention)- Throws:
RemoteException
-
stopMAS
Stops all MAS (the agents, the environment, the controller, ...)- Throws:
RemoteExceptionException
-
stopMAS
- Throws:
Exception
-
dfRegister
- Throws:
RemoteException
-
dfDeRegister
- Throws:
RemoteException
-
dfSearch
- Throws:
RemoteException
-
dfSubscribe
- Throws:
RemoteException
-
getDF
- Throws:
RemoteException
-
getWP
- Throws:
RemoteException
-