|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jason.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 implements a Chain of Responsibilities design pattern. Each member of the chain is a subclass of AgArch. The last arch in the chain is the infrastructure tier (Centralised, JADE, Saci, ...). The getUserAgArch method returns the first arch in the chain. Users can customise the architecture by overriding some this class methods.
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 |
void |
createCustomArchs(java.util.List<java.lang.String> archs)
|
java.util.List<java.lang.String> |
getAgArchClassesChain()
|
java.lang.String |
getAgName()
Gets the agent's name |
AgArchInfraTier |
getArchInfraTier()
returns the last arch in the chain, which is supposed to be the infra tier |
int |
getCycleNumber()
gets the current cycle number in case of running in sync execution mode |
AgArch |
getFirstAgArch()
Returns the first architecture in the chain of responsibility pattern |
AgArch |
getNextAgArch()
|
RuntimeServicesInfraTier |
getRuntimeServices()
Gets an object with infrastructure runtime services |
TransitionSystem |
getTS()
|
void |
incCycleNumber()
|
void |
init()
|
void |
initAg(java.lang.String agClass,
ClassParameters bbPars,
java.lang.String asSrc,
Settings stts)
Deprecated. for arch initialisation you should override the init() method. |
void |
insertAgArch(AgArch arch)
|
boolean |
isRunning()
Checks whether the agent is running |
java.util.List<Literal> |
perceive()
Gets the agent's perception as a list of Literals. |
void |
reasoningCycleStarting()
A call-back method called by TS when a new reasoning cycle is starting |
void |
sendMsg(Message m)
Sends a Jason message |
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 |
stop()
A call-back method called by the infrastructure tier when the agent is about to be killed. |
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 |
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 init() throws java.lang.Exception
java.lang.Exception
public void stop()
public AgArch getFirstAgArch()
public AgArch getNextAgArch()
public java.util.List<java.lang.String> getAgArchClassesChain()
public void insertAgArch(AgArch arch)
public void createCustomArchs(java.util.List<java.lang.String> archs) throws java.lang.Exception
java.lang.Exception
public void reasoningCycleStarting()
public AgArchInfraTier getArchInfraTier()
public TransitionSystem getTS()
public void setTS(TransitionSystem ts)
public java.util.List<Literal> perceive()
perceive
in interface AgArchInfraTier
public void checkMail()
checkMail
in interface AgArchInfraTier
public void act(ActionExec action, java.util.List<ActionExec> feedback)
act
in interface AgArchInfraTier
public boolean canSleep()
canSleep
in interface AgArchInfraTier
public void sleep()
sleep
in interface AgArchInfraTier
public void wake()
AgArchInfraTier
wake
in interface AgArchInfraTier
public RuntimeServicesInfraTier getRuntimeServices()
AgArchInfraTier
getRuntimeServices
in interface AgArchInfraTier
public java.lang.String getAgName()
getAgName
in interface AgArchInfraTier
public void sendMsg(Message m) throws java.lang.Exception
sendMsg
in interface AgArchInfraTier
java.lang.Exception
public void broadcast(Message m) throws java.lang.Exception
broadcast
in interface AgArchInfraTier
java.lang.Exception
public boolean isRunning()
isRunning
in interface AgArchInfraTier
public void setCycleNumber(int cycle)
public void incCycleNumber()
public int getCycleNumber()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |