Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sourceagent.h
Go to the documentation of this file.
1 #ifndef SOURCEAGENT_H
2 #define SOURCEAGENT_H
3 
4 #include "fluxagent.h"
5 
6 namespace LangmuirCore
7 {
8 
12 class SourceAgent : public FluxAgent
13 {
14 public:
18  SourceAgent(World &world, Grid &grid, QObject *parent = 0);
19 
28  bool tryToSeed();
29 
39  bool tryToSeed(int site);
40 
48  bool tryToInject();
49 
50 protected:
58  virtual int chooseSite();
59 
66  virtual bool validToInject(int site)= 0;
67 
75  virtual void inject(int site)= 0;
76 
84  virtual bool shouldTransport(int site);
85 
91  int randomSiteID();
92 
97 };
98 
103 {
104 public:
108  ElectronSourceAgent(World &world, int site, QObject *parent = 0);
109 
113  ElectronSourceAgent(World &world, Grid::CubeFace cubeFace, QObject *parent = 0);
114 protected:
118  virtual bool validToInject(int site);
119 
123  virtual double energyChange(int site);
124 
128  virtual void inject(int site);
129 };
130 
135 {
136 public:
140  HoleSourceAgent(World &world, int site, QObject *parent = 0);
141 
145  HoleSourceAgent(World &world, Grid::CubeFace cubeFace, QObject *parent = 0);
146 protected:
150  virtual bool validToInject(int site);
151 
155  virtual double energyChange(int site);
156 
160  virtual void inject(int site);
161 };
162 
167 {
168 public:
172  ExcitonSourceAgent(World &world, QObject *parent = 0);
173 protected:
177  virtual bool validToInject(int site);
178 
182  virtual double energyChange(int site);
183 
187  virtual bool shouldTransport(int site);
188 
194  virtual int chooseSite();
195 
199  virtual void inject(int site);
200 };
201 
202 }
203 #endif
ElectronSourceAgent(World &world, int site, QObject *parent=0)
create an ElectronSourceAgent at a specific site
virtual void inject(int site)
same as SourceAgent::inject(), but specialized for HoleAgents.
int randomSiteID()
choose a random site ID
A class to inject HoleAgents.
Definition: sourceagent.h:134
SourceAgent(World &world, Grid &grid, QObject *parent=0)
create a SourceAgent
virtual bool shouldTransport(int site)
uses the simple constant probability method
int randomNeighborSiteID()
choose a random site ID from the neighborlist.
A class to inject charges.
Definition: sourceagent.h:12
Grid & grid() const
get the Grid this FluxAgent belongs to
HoleSourceAgent(World &world, int site, QObject *parent=0)
create a HoleSourceAgent at a specific site
virtual double energyChange(int site)
same as FluxAgent::energyChange(), but specialized for HoleAgents.
A class to hold Agents, calculate their positions, and store the background potential.
Definition: cubicgrid.h:35
virtual void inject(int site)
similar to SourceAgent::inject(), but injects both a HoleAgent and an ElectronAgent ...
A class to inject Excitons.
Definition: sourceagent.h:166
virtual void inject(int site)
same as SourceAgent::inject(), but specialized for ElectronAgents.
virtual bool validToInject(int site)=0
checks to see if a carrier can actually be injected at the requested site
A class to change the number of carriers in the system.
Definition: fluxagent.h:17
A class to hold all objects in a simulation.
Definition: world.h:51
virtual bool validToInject(int site)
checks both grids if its ok to inject charges
ExcitonSourceAgent(World &world, QObject *parent=0)
create an ExcitonSourceAgent
virtual bool shouldTransport(int site)
decides if charge should be injected using a constant probability
Definition: agent.h:12
virtual int chooseSite()
choose a site to inject to
bool tryToSeed()
seed a charge at a random site
virtual bool validToInject(int site)
same as SourceAgent::validToInject(), but specialized for HoleAgents.
virtual bool validToInject(int site)
same as SourceAgent::validToInject(), but specialized for ElectronAgents.
virtual double energyChange(int site)
currently implemented as zero and not really used
bool tryToInject()
attempt to inject a carrier
CubeFace
A way to indicate the faces of a cube.
Definition: cubicgrid.h:46
virtual int chooseSite()
choose a site to inject to
virtual void inject(int site)=0
actually injects carrier.
virtual double energyChange(int site)
same as FluxAgent::energyChange(), but specialized for ElectronAgents.
A class to inject ElectronAgents.
Definition: sourceagent.h:102