|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjason.infra.centralised.CentralisedAgArch
public class CentralisedAgArch
This class provides an agent architecture when using Centralised infrastructure to run the MAS inside Jason.
Execution sequence:
Field Summary | |
---|---|
protected CentralisedEnvironment |
infraEnv
|
protected java.util.logging.Logger |
logger
|
protected AgArch |
userAgArch
The user implementation of the architecture |
Constructor Summary | |
---|---|
CentralisedAgArch()
|
Method Summary | |
---|---|
void |
act(ActionExec action,
java.util.List<ActionExec> feedback)
called by the TS to ask the execution of an action in the environment |
void |
actionExecuted(ActionExec action)
called the the environment when the action was executed |
static void |
addMsgListener(MsgListener l)
|
void |
broadcast(Message m)
Broadcasts a Jason message in a specific infrastructure |
boolean |
canSleep()
Returns true whether the agent can sleep according to the arch |
void |
checkMail()
Reads the agent's mailbox and adds messages into the agent's circumstance |
java.lang.String |
getAgName()
Gets the agent's name |
CentralisedExecutionControl |
getControlInfraTier()
|
CentralisedEnvironment |
getEnvInfraTier()
|
java.util.logging.Logger |
getLogger()
|
RuntimeServicesInfraTier |
getRuntimeServices()
Gets an object with infrastructure runtime services |
AgArch |
getUserAgArch()
|
void |
informCycleFinished(boolean breakpoint,
int cycle)
Informs the infrastructure tier controller that the agent has finished its reasoning cycle (used in sync mode). |
void |
initAg(java.lang.String agArchClass,
java.lang.String agClass,
ClassParameters bbPars,
java.lang.String asSrc,
Settings stts,
RunCentralisedMAS masRunner)
Creates the user agent architecture, default architecture is jason.architecture.AgArch. |
boolean |
isRunning()
Checks whether the agent is running (alive) |
java.util.List<Literal> |
perceive()
Gets the agent's perception as a list of Literals |
void |
receiveMsg(Message m)
|
void |
receiveSyncSignal()
inform this agent that it can continue, if it is in sync mode and waiting a signal |
static void |
removeMsgListener(MsgListener l)
|
void |
run()
|
void |
sendMsg(Message m)
Sends a Jason message in a specific infrastructure |
void |
setAgName(java.lang.String name)
|
void |
setControlInfraTier(CentralisedExecutionControl pControl)
|
void |
setEnvInfraTier(CentralisedEnvironment env)
|
void |
setLogger()
|
protected void |
setThread(java.lang.Thread t)
|
void |
setUserAgArch(AgArch arch)
|
void |
sleep()
Put the agent in "sleep" mode |
void |
stopAg()
Stops the agent |
void |
wake()
Removes the agent from the "sleep" mode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CentralisedEnvironment infraEnv
protected AgArch userAgArch
protected java.util.logging.Logger logger
Constructor Detail |
---|
public CentralisedAgArch()
Method Detail |
---|
public static void addMsgListener(MsgListener l)
public static void removeMsgListener(MsgListener l)
public void initAg(java.lang.String agArchClass, java.lang.String agClass, ClassParameters bbPars, java.lang.String asSrc, Settings stts, RunCentralisedMAS masRunner) throws JasonException
JasonException
public void setLogger()
public java.util.logging.Logger getLogger()
public void setAgName(java.lang.String name)
public java.lang.String getAgName()
AgArchInfraTier
getAgName
in interface AgArchInfraTier
public void setUserAgArch(AgArch arch)
public AgArch getUserAgArch()
public void setEnvInfraTier(CentralisedEnvironment env)
public CentralisedEnvironment getEnvInfraTier()
public void setControlInfraTier(CentralisedExecutionControl pControl)
public CentralisedExecutionControl getControlInfraTier()
protected void setThread(java.lang.Thread t)
public void stopAg()
AgArchInfraTier
stopAg
in interface AgArchInfraTier
public boolean isRunning()
AgArchInfraTier
isRunning
in interface AgArchInfraTier
public void run()
run
in interface java.lang.Runnable
public void sleep()
AgArchInfraTier
sleep
in interface AgArchInfraTier
public void wake()
AgArchInfraTier
wake
in interface AgArchInfraTier
public java.util.List<Literal> perceive()
AgArchInfraTier
perceive
in interface AgArchInfraTier
public void sendMsg(Message m) throws ReceiverNotFoundException
AgArchInfraTier
sendMsg
in interface AgArchInfraTier
ReceiverNotFoundException
public void receiveMsg(Message m)
public void broadcast(Message m) throws java.lang.Exception
AgArchInfraTier
broadcast
in interface AgArchInfraTier
java.lang.Exception
public void checkMail()
AgArchInfraTier
checkMail
in interface AgArchInfraTier
public void act(ActionExec action, java.util.List<ActionExec> feedback)
act
in interface AgArchInfraTier
public void actionExecuted(ActionExec action)
public boolean canSleep()
AgArchInfraTier
canSleep
in interface AgArchInfraTier
public void receiveSyncSignal()
public void informCycleFinished(boolean breakpoint, int cycle)
breakpoint is true in case the agent selected one plan with the "breakpoint" annotation.
public RuntimeServicesInfraTier getRuntimeServices()
AgArchInfraTier
getRuntimeServices
in interface AgArchInfraTier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |