public class MusicalAgent extends EnsembleAgent
| Modifier and Type | Class and Description |
|---|---|
private class |
MusicalAgent.CheckDeregister
Classe interna que verifica se todos os componentes estão inicializados e registrados.
|
private class |
MusicalAgent.CheckEndTurn
The Class CheckEndTurn.
|
private class |
MusicalAgent.CheckRegister
Classe interna que verifica se todos os componentes estão inicializados e registrados.
|
private class |
MusicalAgent.Deregister
Verifica se todos os componentes estão finalizados e registrados.
|
private class |
MusicalAgent.KillAgent
Kills this agent.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.ConcurrentHashMap<java.lang.String,MusicalAgentComponent> |
components
The components.
|
private boolean |
dieNextTurn
Controle se o agente deve morrer no próximo turno.
|
protected java.lang.String |
environmentAgent
The environment agent.
|
protected KnowledgeBase |
kb
The kb.
|
private java.util.concurrent.locks.Lock |
lock
The lock.
|
private int |
numberEventHandlersRegistered
Contador de EventHandlers já registrados.
|
private int |
numberEventHandlersRequest
Contador de pedidos de registro de EventHandlers no momento da inicializção.
|
private int |
numberEventsSent
Contador de eventos enviados.
|
private int |
numberReasoning
Contador de raciocínios do agente.
|
private int |
numberReasoningReady
Contador de raciocínios prontos.
|
Constants.MA_STATE |
state
The state.
|
(package private) jade.core.behaviours.ThreadedBehaviourFactory |
tbf
The tbf.
|
isBatch, parameters| Constructor and Description |
|---|
MusicalAgent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(java.lang.String compName,
java.lang.String className,
Parameters arguments)
Adiciona um componente ao agente, seja um raciocínio, sensor, atuador etc.
|
void |
addKB(java.lang.String className,
Parameters parameters)
Adds the kb.
|
protected void |
eventHandlerDeregistered(java.lang.String compName)
Event handler deregistered.
|
protected void |
eventHandlerRegistered(java.lang.String compName)
Event handler registered.
|
protected void |
eventSent()
Event sent.
|
java.lang.String |
getEnvironmentAgent()
Gets the environment agent.
|
KnowledgeBase |
getKB()
Gets the kb.
|
Constants.MA_STATE |
getMAState()
Gets the mA state.
|
protected void |
processControlCommand(Command cmd)
Responsible for validating the commands and their obligatory arguments and executing it.
|
protected void |
reasoningProcessDone(java.lang.String reasoningName)
Reasoning process done.
|
void |
receiveCommand(Command cmd)
A framework-implemented method that receives a command sent by the RouterAgent and calls processCommand.
|
void |
removeComponent(java.lang.String compName)
Remove um componente do Agente.
|
boolean |
start()
Framework-implemented initialization method.
|
boolean |
stop()
Framework-implemented finalization method.
|
configure, finit, getAddress, getAgent, getAgentName, getClock, getParameter, getParameter, getParameters, init, parameterUpdate, processCommand, sendCommand, setParameters, setup, takeDownaddBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, createMessageQueue, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, getState, here, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, removeTimer, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setO2AManager, setQueueSize, waitUntilStarted, writejade.core.behaviours.ThreadedBehaviourFactory tbf
private java.util.concurrent.locks.Lock lock
protected java.lang.String environmentAgent
private java.util.concurrent.ConcurrentHashMap<java.lang.String,MusicalAgentComponent> components
public Constants.MA_STATE state
protected KnowledgeBase kb
private int numberReasoning
private int numberReasoningReady
private int numberEventsSent
private int numberEventHandlersRequest
private int numberEventHandlersRegistered
private boolean dieNextTurn
public final boolean start()
LifeCyclepublic final boolean stop()
LifeCyclepublic final void addKB(java.lang.String className,
Parameters parameters)
className - the class nameparameters - the parameterspublic final void addComponent(java.lang.String compName,
java.lang.String className,
Parameters arguments)
compName - the comp nameclassName - the class namearguments - the argumentspublic final void removeComponent(java.lang.String compName)
compName - the comp namepublic final Constants.MA_STATE getMAState()
public final KnowledgeBase getKB()
public final java.lang.String getEnvironmentAgent()
public final void receiveCommand(Command cmd)
RouterClientcmd - the cmdprotected final void processControlCommand(Command cmd)
cmd - the cmdprotected final void eventHandlerRegistered(java.lang.String compName)
compName - the comp nameprotected final void eventHandlerDeregistered(java.lang.String compName)
compName - the comp nameprotected final void eventSent()
protected final void reasoningProcessDone(java.lang.String reasoningName)
reasoningName - the reasoning name