#include <kernel.h>
Public Member Functions | |
unsigned long | getStep () const |
void | live () |
AgentID_t | getAgentUniqId () |
void | registerAgent (Agent *agent) |
void | registerRole (Agent *agent, Role_t role) |
void | unregisterAgent (Agent *agent) |
void | unregisterRole (Agent *agent, Role_t role) |
void | killAgent (Agent *agent) |
void | sendMessage (Role_t role, const Message &msg) |
void | sendMessageToAgent (AgentID_t agent, const Message &msg) |
Static Public Member Functions | |
static Kernel * | getSingleton () |
Private Types | |
typedef std::map< AgentID_t, Agent * >::iterator | m_white_pages_it |
typedef std::map< Role_t, std::list< Agent * > >::iterator | m_yellow_pages_it |
typedef std::list< Agent * >::iterator | m_agent_set_it |
typedef std::list< Agent * >::iterator | m_agent_dying_it |
Private Member Functions | |
Agent & | getAgentById (AgentID_t agent) |
Private Attributes | |
unsigned long | m_step |
std::map< AgentID_t, Agent * > | m_white_pages |
std::map< Role_t, std::list< Agent * > > | m_yellow_pages |
std::list< Agent * > | m_agent_dying |
AgentID_t | m_agent_uniq_id |
Static Private Attributes | |
static Kernel * | m_singleton = NULL |
Singleton. |
Definition at line 38 of file kernel.h.
|
Return the pointer to the singleton of the kernel.
Definition at line 90 of file kernel.cpp. References m_singleton. |
|
First, remove the agent either from the yellow or the white pages. Then, physically destroy it.
Definition at line 137 of file kernel.cpp. |
|
The main method of the kernel. It must be called in order to execute the agents and other things Definition at line 64 of file kernel.cpp. |