Class LocalEnvironment

java.lang.Object
jason.infra.local.LocalEnvironment
All Implemented Interfaces:
EnvironmentInfraTier

public class LocalEnvironment
extends java.lang.Object
implements EnvironmentInfraTier
This class implements the Local version of the environment infrastructure tier.
  • Field Summary

    Fields
    Modifier and Type Field Description
    private static java.util.logging.Logger logger  
    private BaseLocalMAS masRunner  
    private boolean running  
    private Environment userEnv
    the user customisation class for the environment
  • Constructor Summary

    Constructors
    Constructor Description
    LocalEnvironment​(ClassParameters userEnvArgs, BaseLocalMAS masRunner)  
  • Method Summary

    Modifier and Type Method Description
    void act​(java.lang.String agName, ActionExec action)
    called by the agent infra arch to perform an action in the environment
    void actionExecuted​(java.lang.String agName, Structure actTerm, boolean success, java.lang.Object infraData)
    called by the user implementation of the environment when the action was executed
    RuntimeServices getRuntimeServices()
    Gets an object with infrastructure runtime services
    Environment getUserEnvironment()  
    void informAgsEnvironmentChanged​(java.lang.String... agents)
    Sends a message to the given agents notifying them that the environment has changed (called by the user environment).
    boolean isRunning()
    returns true if the infrastructure environment is running
    void setUserEnvironment​(Environment env)  
    void stop()
    called before the end of MAS execution, it just calls the user environment class stop method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • userEnv

      private Environment userEnv
      the user customisation class for the environment
    • masRunner

      private BaseLocalMAS masRunner
    • running

      private boolean running
    • logger

      private static java.util.logging.Logger logger
  • Constructor Details

  • Method Details

    • isRunning

      public boolean isRunning()
      Description copied from interface: EnvironmentInfraTier
      returns true if the infrastructure environment is running
      Specified by:
      isRunning in interface EnvironmentInfraTier
    • stop

      public void stop()
      called before the end of MAS execution, it just calls the user environment class stop method.
    • setUserEnvironment

      public void setUserEnvironment​(Environment env)
    • getUserEnvironment

      public Environment getUserEnvironment()
    • act

      public void act​(java.lang.String agName, ActionExec action)
      called by the agent infra arch to perform an action in the environment
    • actionExecuted

      public void actionExecuted​(java.lang.String agName, Structure actTerm, boolean success, java.lang.Object infraData)
      Description copied from interface: EnvironmentInfraTier
      called by the user implementation of the environment when the action was executed
      Specified by:
      actionExecuted in interface EnvironmentInfraTier
    • informAgsEnvironmentChanged

      public void informAgsEnvironmentChanged​(java.lang.String... agents)
      Description copied from interface: EnvironmentInfraTier
      Sends a message to the given agents notifying them that the environment has changed (called by the user environment). If no agent is informed, the notification is sent to all agents.
      Specified by:
      informAgsEnvironmentChanged in interface EnvironmentInfraTier
    • getRuntimeServices

      public RuntimeServices getRuntimeServices()
      Description copied from interface: EnvironmentInfraTier
      Gets an object with infrastructure runtime services
      Specified by:
      getRuntimeServices in interface EnvironmentInfraTier