Package jason.runtime
Class DelegatedRuntimeServices
java.lang.Object
jason.runtime.DelegatedRuntimeServices
- All Implemented Interfaces:
RuntimeServices
,Remote
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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).void
dfDeRegister
(String agName, String service, String type) void
dfRegister
(String agName, String service, String type) void
dfSubscribe
(String agName, String service, String type) Returns a set of all agents' namegetAgentSnapshot
(String agName) gets a copy of some agent (BB, PL, ...)int
Gets the number of agents in the MAS.getDF()
getNewAgentName
(String baseName) getWP()
boolean
boolean
Kills the agent named agName as a requested by byAg.loads some ASL code into some agent, if replace is true, the previous plans from the sourceID will be removedvoid
registerDefaultAgArch
(String agArch) register a class to be included as new agents archsrunAsAgent
(String agName, String code) agent agName executes the code (in a new intention)void
startAgent
(String agName) starts an agent (e.g.void
stopMAS
(int deadline, boolean stopJVM, int exitValue) Stops all MAS (the agents, the environment, the controller, ...)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jason.runtime.RuntimeServices
getAgStatus, stopMAS
-
Constructor Details
-
DelegatedRuntimeServices
-
-
Method Details
-
registerDefaultAgArch
Description copied from interface:RuntimeServices
register a class to be included as new agents archs- Specified by:
registerDefaultAgArch
in interfaceRuntimeServices
- Throws:
RemoteException
-
getDefaultAgArchs
- Specified by:
getDefaultAgArchs
in interfaceRuntimeServices
- Throws:
RemoteException
-
getNewAgentName
- Specified by:
getNewAgentName
in interfaceRuntimeServices
- Throws:
RemoteException
-
createAgent
public String createAgent(String agName, String agSource, String agClass, List<String> archClasses, ClassParameters bbPars, Settings stts, Agent father) throws Exception, RemoteException Description copied from interface:RuntimeServices
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
- Specified by:
createAgent
in interfaceRuntimeServices
- Throws:
Exception
RemoteException
-
isRunning
- Specified by:
isRunning
in interfaceRuntimeServices
- Throws:
RemoteException
-
startAgent
Description copied from interface:RuntimeServices
starts an agent (e.g. create thread for it)- Specified by:
startAgent
in interfaceRuntimeServices
- Throws:
RemoteException
-
clone
public void clone(Agent source, List<String> archClasses, String agName) throws RemoteException, JasonException Description copied from interface:RuntimeServices
Clones an agent and starts it- Specified by:
clone
in interfaceRuntimeServices
- 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
-
getAgentsName
Description copied from interface:RuntimeServices
Returns a set of all agents' name- Specified by:
getAgentsName
in interfaceRuntimeServices
- Throws:
RemoteException
-
getAgentsQty
Description copied from interface:RuntimeServices
Gets the number of agents in the MAS.- Specified by:
getAgentsQty
in interfaceRuntimeServices
- Throws:
RemoteException
-
getAgentSnapshot
Description copied from interface:RuntimeServices
gets a copy of some agent (BB, PL, ...)- Specified by:
getAgentSnapshot
in interfaceRuntimeServices
- Throws:
RemoteException
-
getMASName
- Specified by:
getMASName
in interfaceRuntimeServices
- Throws:
RemoteException
-
loadASL
public String loadASL(String agName, String code, String sourceId, boolean replace) throws RemoteException Description copied from interface:RuntimeServices
loads some ASL code into some agent, if replace is true, the previous plans from the sourceID will be removed- Specified by:
loadASL
in interfaceRuntimeServices
- Throws:
RemoteException
-
runAsAgent
Description copied from interface:RuntimeServices
agent agName executes the code (in a new intention)- Specified by:
runAsAgent
in interfaceRuntimeServices
- Throws:
RemoteException
-
killAgent
Description copied from interface:RuntimeServices
Kills the agent named agName as a requested by byAg. Agent.stopAg() method is called before the agent is removed.- Specified by:
killAgent
in interfaceRuntimeServices
- Throws:
RemoteException
-
stopMAS
Description copied from interface:RuntimeServices
Stops all MAS (the agents, the environment, the controller, ...)- Specified by:
stopMAS
in interfaceRuntimeServices
- Throws:
RemoteException
Exception
-
dfRegister
- Specified by:
dfRegister
in interfaceRuntimeServices
- Throws:
RemoteException
-
dfDeRegister
- Specified by:
dfDeRegister
in interfaceRuntimeServices
- Throws:
RemoteException
-
dfSearch
- Specified by:
dfSearch
in interfaceRuntimeServices
- Throws:
RemoteException
-
dfSubscribe
- Specified by:
dfSubscribe
in interfaceRuntimeServices
- Throws:
RemoteException
-
getDF
- Specified by:
getDF
in interfaceRuntimeServices
- Throws:
RemoteException
-
getWP
- Specified by:
getWP
in interfaceRuntimeServices
- Throws:
RemoteException
-