Package jason.infra.local
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 environmentvoid
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 executedRuntimeServices
getRuntimeServices()
Gets an object with infrastructure runtime servicesEnvironment
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 runningvoid
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
the user customisation class for the environment -
masRunner
-
running
private boolean running -
logger
private static java.util.logging.Logger logger
-
-
Constructor Details
-
LocalEnvironment
- Throws:
JasonException
-
-
Method Details
-
isRunning
public boolean isRunning()Description copied from interface:EnvironmentInfraTier
returns true if the infrastructure environment is running- Specified by:
isRunning
in interfaceEnvironmentInfraTier
-
stop
public void stop()called before the end of MAS execution, it just calls the user environment class stop method. -
setUserEnvironment
-
getUserEnvironment
-
act
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 interfaceEnvironmentInfraTier
-
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 interfaceEnvironmentInfraTier
-
getRuntimeServices
Description copied from interface:EnvironmentInfraTier
Gets an object with infrastructure runtime services- Specified by:
getRuntimeServices
in interfaceEnvironmentInfraTier
-