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 void
Clones 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 void
dfDeRegister
(String agName, String service, String type) default void
dfRegister
(String agName, String service, String type) default Collection
<String> default void
dfSubscribe
(String agName, String service, String type) Returns a set of all agents' namedefault Agent
getAgentSnapshot
(String agName) gets a copy of some agent (BB, PL, ...)int
Gets the number of agents in the MAS.getAgStatus
(String agName) default Collection
<String> getDF()
default String
getNewAgentName
(String baseName) getWP()
boolean
boolean
Kills the agent named agName as a requested by byAg.default String
loads some ASL code into some agent, if replace is true, the previous plans from the sourceID will be removeddefault void
registerDefaultAgArch
(String agArch) register a class to be included as new agents archsdefault String
runAsAgent
(String agName, String code) agent agName executes the code (in a new intention)void
startAgent
(String agName) starts an agent (e.g.default void
stopMAS()
void
stopMAS
(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:
Exception
RemoteException
-
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:
JasonException
RemoteException
-
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:
RemoteException
Exception
-
stopMAS
- Throws:
Exception
-
dfRegister
- Throws:
RemoteException
-
dfDeRegister
- Throws:
RemoteException
-
dfSearch
- Throws:
RemoteException
-
dfSubscribe
- Throws:
RemoteException
-
getDF
- Throws:
RemoteException
-
getWP
- Throws:
RemoteException
-