public class CentralisedAgArch extends AgArch implements java.lang.Runnable
Execution sequence:
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
agName |
private RConf |
conf |
private int |
cycles |
private int |
cyclesAct |
private int |
cyclesDeliberate |
private int |
cyclesSense |
private CentralisedExecutionControl |
infraControl |
protected CentralisedEnvironment |
infraEnv |
private boolean |
inWaitSyncMonitor |
protected java.util.logging.Logger |
logger |
private BaseCentralisedMAS |
masRunner |
static int |
MAX_SLEEP |
private java.util.Queue<Message> |
mbox |
private static java.util.List<MsgListener> |
msgListeners |
private java.lang.Thread |
myThread |
private boolean |
running |
private java.lang.Object |
sleepSync |
private int |
sleepTime |
private java.lang.Object |
syncMonitor |
Constructor and Description |
---|
CentralisedAgArch() |
Modifier and Type | Method and Description |
---|---|
protected void |
act() |
void |
act(ActionExec action)
called by the TS to ask the execution of an action in the environment
|
static void |
addMsgListener(MsgListener l) |
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 |
createArchs(java.util.List<java.lang.String> agArchClasses,
Agent ag,
BaseCentralisedMAS masRunner)
init the agent architecture based on another agent
|
void |
createArchs(java.util.List<java.lang.String> agArchClasses,
java.lang.String agClass,
ClassParameters bbPars,
java.lang.String asSrc,
Settings stts,
BaseCentralisedMAS masRunner)
Creates the user agent architecture, default architecture is
jason.architecture.AgArch.
|
protected void |
deliberate() |
java.lang.String |
getAgName()
Gets the agent's name
|
RConf |
getConf() |
CentralisedExecutionControl |
getControlInfraTier() |
int |
getCycles() |
int |
getCyclesAct() |
int |
getCyclesDeliberate() |
int |
getCyclesSense() |
CentralisedEnvironment |
getEnvInfraTier() |
java.util.logging.Logger |
getLogger() |
java.util.Collection<Message> |
getMBox() |
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).
|
boolean |
isRunning()
Checks whether the agent is running
|
java.util.Collection<Literal> |
perceive()
Gets the agent's perception as a list of Literals.
|
protected void |
reasoningCycle() |
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
|
protected void |
sense() |
void |
setAgName(java.lang.String name) |
void |
setConf(RConf conf) |
void |
setControlInfraTier(CentralisedExecutionControl pControl) |
void |
setCycles(int cycles) |
void |
setCyclesAct(int cyclesAct) |
void |
setCyclesDeliberate(int cyclesDeliberate) |
void |
setCyclesSense(int cyclesSense) |
void |
setEnvInfraTier(CentralisedEnvironment env) |
void |
setLogger() |
void |
setThread(java.lang.Thread t) |
void |
sleep() |
void |
startThread() |
void |
stopAg() |
private void |
waitSyncSignal()
waits for a signal to continue the execution (used in synchronised
execution mode)
|
void |
wake()
Puts the agent in sleep.
|
void |
wakeUpAct() |
void |
wakeUpDeliberate() |
void |
wakeUpSense() |
actionExecuted, compareTo, createCustomArchs, equals, getAgArchClassesChain, getArchInfraTier, getCycleNumber, getFirstAgArch, getNextAgArch, getTS, hashCode, incCycleNumber, init, insertAgArch, reasoningCycleStarting, setCycleNumber, setTS, stop, toString
protected CentralisedEnvironment infraEnv
private CentralisedExecutionControl infraControl
private BaseCentralisedMAS masRunner
private java.lang.String agName
private volatile boolean running
private java.util.Queue<Message> mbox
protected java.util.logging.Logger logger
private static java.util.List<MsgListener> msgListeners
private java.lang.Thread myThread
private java.lang.Object sleepSync
private int sleepTime
public static final int MAX_SLEEP
private java.lang.Object syncMonitor
private volatile boolean inWaitSyncMonitor
private RConf conf
private int cycles
private int cyclesSense
private int cyclesDeliberate
private int cyclesAct
public static void addMsgListener(MsgListener l)
public static void removeMsgListener(MsgListener l)
public void createArchs(java.util.List<java.lang.String> agArchClasses, java.lang.String agClass, ClassParameters bbPars, java.lang.String asSrc, Settings stts, BaseCentralisedMAS masRunner) throws JasonException
JasonException
public void createArchs(java.util.List<java.lang.String> agArchClasses, Agent ag, BaseCentralisedMAS masRunner) throws JasonException
JasonException
public void stopAg()
public void setLogger()
public java.util.logging.Logger getLogger()
public void setAgName(java.lang.String name) throws JasonException
JasonException
public java.lang.String getAgName()
AgArch
getAgName
in interface AgArchInfraTier
getAgName
in class AgArch
public AgArch getUserAgArch()
public void setEnvInfraTier(CentralisedEnvironment env)
public CentralisedEnvironment getEnvInfraTier()
public void setControlInfraTier(CentralisedExecutionControl pControl)
public CentralisedExecutionControl getControlInfraTier()
public void setThread(java.lang.Thread t)
public void startThread()
public boolean isRunning()
AgArch
isRunning
in interface AgArchInfraTier
isRunning
in class AgArch
protected void sense()
protected void deliberate()
protected void act()
protected void reasoningCycle()
public void run()
run
in interface java.lang.Runnable
public void sleep()
public void wake()
AgArch
wake
in interface AgArchInfraTier
wake
in class AgArch
public void wakeUpSense()
wakeUpSense
in class AgArch
public void wakeUpDeliberate()
wakeUpDeliberate
in class AgArch
public java.util.Collection<Literal> perceive()
AgArch
perceive
in interface AgArchInfraTier
perceive
in class AgArch
public void sendMsg(Message m) throws ReceiverNotFoundException
AgArch
sendMsg
in interface AgArchInfraTier
sendMsg
in class AgArch
ReceiverNotFoundException
public void receiveMsg(Message m)
public void broadcast(Message m) throws java.lang.Exception
AgArch
broadcast
in interface AgArchInfraTier
broadcast
in class AgArch
java.lang.Exception
public void checkMail()
AgArch
checkMail
in interface AgArchInfraTier
checkMail
in class AgArch
public java.util.Collection<Message> getMBox()
public void act(ActionExec action)
act
in interface AgArchInfraTier
act
in class AgArch
public boolean canSleep()
AgArch
canSleep
in interface AgArchInfraTier
canSleep
in class AgArch
private void waitSyncSignal()
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
getRuntimeServices
in class AgArch
public void setConf(RConf conf)
public RConf getConf()
public int getCycles()
public void setCycles(int cycles)
public int getCyclesSense()
public void setCyclesSense(int cyclesSense)
public int getCyclesDeliberate()
public void setCyclesDeliberate(int cyclesDeliberate)
public int getCyclesAct()
public void setCyclesAct(int cyclesAct)