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 agent
    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)
    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' name
    int 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 archs
    void 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

  • Constructor Details

    • DelegatedRuntimeServices

      public DelegatedRuntimeServices​(RuntimeServices delegate)
  • 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 interface RuntimeServices
    • getDefaultAgArchs

      public java.util.Collection<java.lang.String> getDefaultAgArchs()
      Specified by:
      getDefaultAgArchs in interface RuntimeServices
    • getNewAgentName

      public java.lang.String getNewAgentName​(java.lang.String baseName)
      Specified by:
      getNewAgentName in interface RuntimeServices
    • 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.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

      Specified by:
      createAgent in interface RuntimeServices
      Throws:
      java.lang.Exception
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface RuntimeServices
    • 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 interface RuntimeServices
    • clone

      public AgArch clone​(Agent source, java.util.Collection<java.lang.String> archClasses, java.lang.String agName) throws JasonException
      Description copied from interface: RuntimeServices
      Clones an agent
      Specified by:
      clone in interface RuntimeServices
      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 interface RuntimeServices
    • getAgentsQty

      public int getAgentsQty()
      Description copied from interface: RuntimeServices
      Gets the number of agents in the MAS.
      Specified by:
      getAgentsQty in interface RuntimeServices
    • 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 interface RuntimeServices
    • stopMAS

      public void stopMAS​(int deadline, boolean stopJVM, int exitValue) throws java.lang.Exception
      Description copied from interface: RuntimeServices
      Stops all MAS (the agents, the environment, the controller, ...)
      Specified by:
      stopMAS in interface RuntimeServices
      Throws:
      java.lang.Exception
    • dfRegister

      public void dfRegister​(java.lang.String agName, java.lang.String service, java.lang.String type)
      Specified by:
      dfRegister in interface RuntimeServices
    • dfDeRegister

      public void dfDeRegister​(java.lang.String agName, java.lang.String service, java.lang.String type)
      Specified by:
      dfDeRegister in interface RuntimeServices
    • dfSearch

      public java.util.Collection<java.lang.String> dfSearch​(java.lang.String service, java.lang.String type)
      Specified by:
      dfSearch in interface RuntimeServices
    • dfSubscribe

      public void dfSubscribe​(java.lang.String agName, java.lang.String service, java.lang.String type)
      Specified by:
      dfSubscribe in interface RuntimeServices
    • getDF

      public java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getDF()
      Specified by:
      getDF in interface RuntimeServices
    • getWP

      public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Object>> getWP()
      Specified by:
      getWP in interface RuntimeServices