Package jason.infra.local
Class LocalRuntimeServices
java.lang.Object
jason.infra.local.BaseRuntimeServices
jason.infra.local.LocalRuntimeServices
- All Implemented Interfaces:
RuntimeServices
public class LocalRuntimeServices extends BaseRuntimeServices
This class implements the Local version of the runtime services.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
logger
Fields inherited from class jason.infra.local.BaseRuntimeServices
masRunner
-
Constructor Summary
Constructors Constructor Description LocalRuntimeServices(BaseLocalMAS masRunner)
-
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).boolean
isRunning()
boolean
killAgent(java.lang.String agName, java.lang.String byAg, int deadline)
Kills the agent named agName as a requested by byAg.protected LocalAgArch
newAgInstance()
void
startAgent(java.lang.String agName)
starts an agent (e.g.Methods inherited from class jason.infra.local.BaseRuntimeServices
dfDeRegister, dfRegister, dfSearch, dfSubscribe, getAgentsNames, getAgentsQty, getDefaultAgArchs, getDF, getNewAgentName, getWP, registerDefaultAgArch, stopMAS
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
-
logger
private static java.util.logging.Logger logger
-
-
Constructor Details
-
LocalRuntimeServices
-
-
Method Details
-
isRunning
public boolean isRunning() -
newAgInstance
-
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
- Throws:
java.lang.Exception
-
startAgent
public void startAgent(java.lang.String agName)Description copied from interface:RuntimeServices
starts an agent (e.g. create thread for it) -
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- Parameters:
source
- : the agent used as source for beliefs, plans, ...agName
- : the name of the clone- Returns:
- the agent arch created
- Throws:
JasonException
-
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.
-