Class LocalRuntimeServices

java.lang.Object
jason.infra.local.BaseRuntimeServices
jason.infra.local.LocalRuntimeServices
All Implemented Interfaces:
RuntimeServices, Remote

public class LocalRuntimeServices extends BaseRuntimeServices
This class implements the Local version of the runtime services.
  • Constructor Details

    • LocalRuntimeServices

      public LocalRuntimeServices(BaseLocalMAS masRunner)
  • Method Details

    • isRunning

      public boolean isRunning()
    • newAgInstance

      protected LocalAgArch 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

      public void startAgent(String agName)
      Description copied from interface: RuntimeServices
      starts an agent (e.g. create thread for it)
    • clone

      public void clone(Agent source, List<String> archClasses, String agName) throws JasonException
      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 used
      agName - : the name of the clone return the agent arch created
      Throws:
      JasonException
    • killAgent

      public boolean killAgent(String agName, 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.
    • getMASName

      public String getMASName()
    • getAgStatus

      public Map<String,Object> getAgStatus(String agName)
    • getAgentSnapshot

      public Agent getAgentSnapshot(String agName)
      Description copied from interface: RuntimeServices
      gets a copy of some agent (BB, PL, ...)
    • loadASL

      public String loadASL(String agName, String code, String sourceId, boolean replace)
      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

      public String runAsAgent(String agName, String code)
      Description copied from interface: RuntimeServices
      agent agName executes the code (in a new intention)