|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjason.architecture.AgArch
public class AgArch
Base agent architecture class that defines the overall agent architecture; the AS interpreter is the reasoner (a kind of mind) within this architecture (a kind of body).
The agent reasoning cycle (implemented in TransitionSystem class) calls these methods to get perception, action, and communication.
This class normally just calls the AgArchInfraTier methods implemented by the infrastructure tier (Centralised, JADE, Saci, ...). However, the user can customise these methods overriding some of them in his/her arch. class.
Constructor Summary | |
---|---|
AgArch()
|
Method Summary | |
---|---|
void |
act(ActionExec action,
java.util.List<ActionExec> feedback)
Executes the action action and, when finished, add it back in feedback actions. |
void |
broadcast(Message m)
Broadcasts a Jason message |
boolean |
canSleep()
Returns true if the agent can enter in sleep mode. |
void |
checkMail()
Reads the agent's mailbox and adds messages into the agent's circumstance |
java.lang.String |
getAgName()
Gets the agent's name |
AgArchInfraTier |
getArchInfraTier()
|
int |
getCycleNumber()
gets the current cycle number in case of running in sync execution mode |
TransitionSystem |
getTS()
|
void |
initAg(java.lang.String agClass,
ClassParameters bbPars,
java.lang.String asSrc,
Settings stts)
Creates the agent class defined by agClass, default is jason.asSemantics.Agent. |
boolean |
isRunning()
Checks whether the agent is running |
java.util.List<Literal> |
perceive()
Gets the agent's perception as a list of Literals. |
void |
sendMsg(Message m)
Sends a Jason message |
void |
setArchInfraTier(AgArchInfraTier ai)
|
void |
setCycleNumber(int cycle)
sets the number of the current cycle in the sync execution mode |
void |
setTS(TransitionSystem ts)
|
void |
sleep()
Puts the agent in sleep. |
void |
stopAg()
A call-back method called by the infrastructure tier when the agent is about to be killed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AgArch()
Method Detail |
---|
public void initAg(java.lang.String agClass, ClassParameters bbPars, java.lang.String asSrc, Settings stts) throws JasonException
JasonException
public void stopAg()
public void setArchInfraTier(AgArchInfraTier ai)
public AgArchInfraTier getArchInfraTier()
public TransitionSystem getTS()
public void setTS(TransitionSystem ts)
public java.util.List<Literal> perceive()
public void checkMail()
public void act(ActionExec action, java.util.List<ActionExec> feedback)
public boolean canSleep()
public void sleep()
public java.lang.String getAgName()
public void sendMsg(Message m) throws java.lang.Exception
java.lang.Exception
public void broadcast(Message m) throws java.lang.Exception
java.lang.Exception
public boolean isRunning()
public void setCycleNumber(int cycle)
public int getCycleNumber()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |