|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjason.environment.Environment
public class Environment
It is a base class for Environment, it is overridden by the user application to define the environment "behaviour".
Execution sequence:
Field Summary | |
---|---|
protected java.util.concurrent.ExecutorService |
executor
|
Constructor Summary | |
---|---|
Environment()
creates an environment class with the default number of threads in the pool |
|
Environment(int n)
creates an environment class with n threads to execute actions required by the agents |
Method Summary | |
---|---|
void |
addPercept(Literal per)
Adds a perception for all agents |
void |
addPercept(java.lang.String agName,
Literal per)
Adds a perception for a specific agent |
void |
clearPercepts()
Clears the list of global percepts |
void |
clearPercepts(java.lang.String agName)
Clears the list of percepts of a specific agent |
boolean |
containsPercept(Literal per)
Returns true if the list of common percepts contains the perception per. |
boolean |
containsPercept(java.lang.String agName,
Literal per)
|
boolean |
executeAction(java.lang.String agName,
Structure act)
Executes an action on the environment. |
EnvironmentInfraTier |
getEnvironmentInfraTier()
|
java.util.logging.Logger |
getLogger()
|
java.util.List<Literal> |
getPercepts(java.lang.String agName)
Returns percepts for an agent. |
void |
informAgsEnvironmentChanged(java.util.Collection<java.lang.String> agents)
Deprecated. use version with String... parameter |
void |
informAgsEnvironmentChanged(java.lang.String... agents)
|
void |
init(java.lang.String[] args)
Called before the MAS execution with the args informed in .mas2j project, the user environment could override it. |
boolean |
isRunning()
|
boolean |
removePercept(Literal per)
Removes a perception in the common perception list |
boolean |
removePercept(java.lang.String agName,
Literal per)
Removes a perception for an agent |
int |
removePerceptsByUnif(Literal per)
Removes all percepts in the common perception list that unifies with per. |
int |
removePerceptsByUnif(java.lang.String agName,
Literal per)
Removes from an agent perception all percepts that unifies with per. |
void |
scheduleAction(java.lang.String agName,
Structure action,
java.lang.Object infraData)
Called by the agent infrastructure to schedule an action to be executed on the environment |
void |
setEnvironmentInfraTier(EnvironmentInfraTier je)
Sets the infrastructure tier of the environment (saci, jade, centralised, ...) |
void |
stop()
Called just before the end of MAS execution, the user environment could override it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.concurrent.ExecutorService executor
Constructor Detail |
---|
public Environment(int n)
public Environment()
Method Detail |
---|
public void init(java.lang.String[] args)
public void stop()
public boolean isRunning()
public void setEnvironmentInfraTier(EnvironmentInfraTier je)
public EnvironmentInfraTier getEnvironmentInfraTier()
public java.util.logging.Logger getLogger()
public void informAgsEnvironmentChanged(java.util.Collection<java.lang.String> agents)
public void informAgsEnvironmentChanged(java.lang.String... agents)
public java.util.List<Literal> getPercepts(java.lang.String agName)
public void addPercept(Literal per)
public boolean removePercept(Literal per)
public int removePerceptsByUnif(Literal per)
public void clearPercepts()
public boolean containsPercept(Literal per)
public void addPercept(java.lang.String agName, Literal per)
public boolean removePercept(java.lang.String agName, Literal per)
public int removePerceptsByUnif(java.lang.String agName, Literal per)
public boolean containsPercept(java.lang.String agName, Literal per)
public void clearPercepts(java.lang.String agName)
public void scheduleAction(java.lang.String agName, Structure action, java.lang.Object infraData)
public boolean executeAction(java.lang.String agName, Structure act)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |