Package jason.runtime
Class DelegatedRuntimeServices
java.lang.Object
jason.runtime.DelegatedRuntimeServices
- All Implemented Interfaces:
RuntimeServices
public class DelegatedRuntimeServices extends java.lang.Object implements RuntimeServices
-
Field Summary
Fields Modifier and Type Field Description private RuntimeServices
delegate
-
Constructor Summary
Constructors Constructor Description DelegatedRuntimeServices(RuntimeServices delegate)
-
Method Summary
Modifier and Type Method Description AgArch
clone(Agent source, java.util.Collection<java.lang.String> archClasses, java.lang.String agName)
Clones an agentjava.lang.String
createAgent(java.lang.String agName, java.lang.String agSource, java.lang.String agClass, java.util.Collection<java.lang.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(java.lang.String agName, java.lang.String service, java.lang.String type)
void
dfRegister(java.lang.String agName, java.lang.String service, java.lang.String type)
java.util.Collection<java.lang.String>
dfSearch(java.lang.String service, java.lang.String type)
void
dfSubscribe(java.lang.String agName, java.lang.String service, java.lang.String type)
java.util.Collection<java.lang.String>
getAgentsNames()
Returns a set of all agents' nameint
getAgentsQty()
Gets the number of agents in the MAS.java.util.Collection<java.lang.String>
getDefaultAgArchs()
java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
getDF()
java.lang.String
getNewAgentName(java.lang.String baseName)
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>
getWP()
boolean
isRunning()
boolean
killAgent(java.lang.String agName, java.lang.String byAg, int deadline)
Kills the agent named agName as a requested by byAg.void
registerDefaultAgArch(java.lang.String agArch)
register a class to be included as new agents archsvoid
startAgent(java.lang.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
stopMAS
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatedRuntimeServices
-
-
Method Details
-
registerDefaultAgArch
public void registerDefaultAgArch(java.lang.String agArch)Description copied from interface:RuntimeServices
register a class to be included as new agents archs- Specified by:
registerDefaultAgArch
in interfaceRuntimeServices
-
getDefaultAgArchs
public java.util.Collection<java.lang.String> getDefaultAgArchs()- Specified by:
getDefaultAgArchs
in interfaceRuntimeServices
-
getNewAgentName
public java.lang.String getNewAgentName(java.lang.String baseName)- Specified by:
getNewAgentName
in interfaceRuntimeServices
-
createAgent
public java.lang.String createAgent(java.lang.String agName, java.lang.String agSource, java.lang.String agClass, java.util.Collection<java.lang.String> archClasses, ClassParameters bbPars, Settings stts, Agent father) throws java.lang.ExceptionDescription 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:
java.lang.Exception
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceRuntimeServices
-
startAgent
public void startAgent(java.lang.String agName)Description copied from interface:RuntimeServices
starts an agent (e.g. create thread for it)- Specified by:
startAgent
in interfaceRuntimeServices
-
clone
public AgArch clone(Agent source, java.util.Collection<java.lang.String> archClasses, java.lang.String agName) throws JasonExceptionDescription copied from interface:RuntimeServices
Clones an agent- Specified by:
clone
in interfaceRuntimeServices
- Parameters:
source
- : the agent used as source for beliefs, plans, ...agName
- : the name of the clone- Returns:
- the agent arch created
- Throws:
JasonException
-
getAgentsNames
public java.util.Collection<java.lang.String> getAgentsNames()Description copied from interface:RuntimeServices
Returns a set of all agents' name- Specified by:
getAgentsNames
in interfaceRuntimeServices
-
getAgentsQty
public int getAgentsQty()Description copied from interface:RuntimeServices
Gets the number of agents in the MAS.- Specified by:
getAgentsQty
in interfaceRuntimeServices
-
killAgent
public boolean killAgent(java.lang.String agName, java.lang.String byAg, int deadline)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
-
stopMAS
public void stopMAS(int deadline, boolean stopJVM, int exitValue) throws java.lang.ExceptionDescription copied from interface:RuntimeServices
Stops all MAS (the agents, the environment, the controller, ...)- Specified by:
stopMAS
in interfaceRuntimeServices
- Throws:
java.lang.Exception
-
dfRegister
public void dfRegister(java.lang.String agName, java.lang.String service, java.lang.String type)- Specified by:
dfRegister
in interfaceRuntimeServices
-
dfDeRegister
public void dfDeRegister(java.lang.String agName, java.lang.String service, java.lang.String type)- Specified by:
dfDeRegister
in interfaceRuntimeServices
-
dfSearch
public java.util.Collection<java.lang.String> dfSearch(java.lang.String service, java.lang.String type)- Specified by:
dfSearch
in interfaceRuntimeServices
-
dfSubscribe
public void dfSubscribe(java.lang.String agName, java.lang.String service, java.lang.String type)- Specified by:
dfSubscribe
in interfaceRuntimeServices
-
getDF
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getDF()- Specified by:
getDF
in interfaceRuntimeServices
-
getWP
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getWP()- Specified by:
getWP
in interfaceRuntimeServices
-