Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

Kernel Class Reference

#include <kernel.h>

List of all members.

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 KernelgetSingleton ()

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

AgentgetAgentById (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 Kernelm_singleton = NULL
 Singleton.


Detailed Description

This is the kernel of the Multi-Agent System.
Author:
Victor STINNER

Definition at line 38 of file kernel.h.


Member Function Documentation

Kernel * Kernel::getSingleton  )  [static]
 

Return the pointer to the singleton of the kernel.

Returns:
The pointer to the only one kernel of the application, otherwise null

Definition at line 90 of file kernel.cpp.

References m_singleton.

void Kernel::killAgent Agent agent  ) 
 

First, remove the agent either from the yellow or the white pages. Then, physically destroy it.

Parameters:
agent The pointer to the agent to destroy

Definition at line 137 of file kernel.cpp.

void Kernel::live  ) 
 

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.


The documentation for this class was generated from the following files:
Generated on Sat Nov 11 10:21:11 2006 for OpenCity by  doxygen 1.4.2