Package jason.infra.local
Class LocalRuntimeServices
java.lang.Object
jason.infra.local.BaseRuntimeServices
jason.infra.local.LocalRuntimeServices
- All Implemented Interfaces:
RuntimeServices
,Remote
This class implements the Local version of the runtime services.
-
Field Summary
Fields inherited from class jason.infra.local.BaseRuntimeServices
masRunner
-
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).getAgentSnapshot
(String agName) gets a copy of some agent (BB, PL, ...)getAgStatus
(String agName) 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 removedprotected LocalAgArch
runAsAgent
(String agName, String code) agent agName executes the code (in a new intention)void
startAgent
(String agName) starts an agent (e.g.Methods inherited from class jason.infra.local.BaseRuntimeServices
dfDeRegister, dfRegister, dfSearch, dfSubscribe, getAgentsName, 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
-
Constructor Details
-
LocalRuntimeServices
-
-
Method Details
-
isRunning
public boolean isRunning() -
newAgInstance
-
createAgent
public String createAgent(String agName, String agSource, String agClass, List<String> archClasses, ClassParameters bbPars, Settings stts, Agent father) throws Exception 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
- Throws:
Exception
-
startAgent
Description copied from interface:RuntimeServices
starts an agent (e.g. create thread for it) -
clone
Description copied from interface:RuntimeServices
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
-
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. -
getMASName
-
getAgStatus
-
getAgentSnapshot
Description copied from interface:RuntimeServices
gets a copy of some agent (BB, PL, ...) -
loadASL
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 -
runAsAgent
Description copied from interface:RuntimeServices
agent agName executes the code (in a new intention)
-