Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LangmuirCore::Agent Class Reference

A class that abstractly represents an object that can occupy grid sites. More...

#include <agent.h>

Public Types

enum  Type {
  Empty = 0, Electron = 1, Hole = 2, Defect = 3,
  Source = 4, Drain = 5, SIZE = 6
}
 An identifier for the type of Agent. More...
 

Public Member Functions

 Agent (Type type, World &world, int site=0, QObject *parent=0)
 Create an Agent. More...
 
virtual ~Agent ()
 Destroy Agent. More...
 
const QVector< int > & getNeighbors () const
 Get Agent neighbor list. More...
 
void setNeighbors (QVector< int > neighbors)
 Set Agent neighbor list. More...
 
int getCurrentSite () const
 Get Agent current site. More...
 
int getFutureSite () const
 Get Agent future site. More...
 
void setCurrentSite (int site)
 Set Agent current site. More...
 
void setFutureSite (int site)
 Set Agent future site. More...
 
Type getType () const
 Get Agent::Type enum. More...
 
WorldgetWorld () const
 Get Langmuir::World reference. More...
 

Static Public Member Functions

static QString toQString (const Agent::Type e)
 Convert Agent type enum to QString. More...
 

Protected Attributes

int m_site
 Current site the Agent occupies. More...
 
int m_fSite
 Future site the Agent will occupy. More...
 
Worldm_world
 Reference to World object. More...
 
QVector< int > m_neighbors
 List fo neighboring site ids. More...
 
Type m_type
 Agent Type enum. More...
 

Detailed Description

A class that abstractly represents an object that can occupy grid sites.

Agents can be Electrons, Holes, Defects, Sources, or Drains. The Agent class encodes basic information that all agents have, regardless of their type. For examples, all agents occupy a grid site, have knowledge of their neighboring sites, and know their own type.

Member Enumeration Documentation

An identifier for the type of Agent.

Enumerator
Empty 

Empty Grid site.

Electron 

ElectronAgent.

Hole 

HoleAgent.

Defect 

Defective Grid site.

Source 

SourceAgent.

Drain 

DrainAgent.

SIZE 

Number of Agent Types.

Constructor & Destructor Documentation

LangmuirCore::Agent::Agent ( Type  type,
World world,
int  site = 0,
QObject *  parent = 0 
)
inline

Create an Agent.

Parameters
typeidentifier enum
  • for example: Electron, Hole, etc.
worldreference world object
sitegrid site id Agent occupies
parentparent QObject
LangmuirCore::Agent::~Agent ( )
inlinevirtual

Destroy Agent.

Member Function Documentation

int LangmuirCore::Agent::getCurrentSite ( ) const
inline

Get Agent current site.

int LangmuirCore::Agent::getFutureSite ( ) const
inline

Get Agent future site.

const QVector< int > & LangmuirCore::Agent::getNeighbors ( ) const
inline

Get Agent neighbor list.

Agent::Type LangmuirCore::Agent::getType ( ) const
inline

Get Agent::Type enum.

World & LangmuirCore::Agent::getWorld ( ) const
inline

Get Langmuir::World reference.

void LangmuirCore::Agent::setCurrentSite ( int  site)
inline

Set Agent current site.

void LangmuirCore::Agent::setFutureSite ( int  site)
inline

Set Agent future site.

void LangmuirCore::Agent::setNeighbors ( QVector< int >  neighbors)
inline

Set Agent neighbor list.

QString LangmuirCore::Agent::toQString ( const Agent::Type  e)
inlinestatic

Convert Agent type enum to QString.

Member Data Documentation

int LangmuirCore::Agent::m_fSite
protected

Future site the Agent will occupy.

QVector<int> LangmuirCore::Agent::m_neighbors
protected

List fo neighboring site ids.

int LangmuirCore::Agent::m_site
protected

Current site the Agent occupies.

Type LangmuirCore::Agent::m_type
protected

Agent Type enum.

World& LangmuirCore::Agent::m_world
protected

Reference to World object.


The documentation for this class was generated from the following file: