29 #ifndef ELEMENT_DMOVER_H
30 #define ELEMENT_DMOVER_H
45 typedef typename CC::ATOM_TYPE T;
46 typedef typename CC::PARAM_CONFIG P;
48 R = P::EVENT_WINDOW_RADIUS,
62 m_searchRadius(
this,
"radius",
"Scan radius",
63 "Max radius to search for empty and non-empty sites.", 0, 1, R)
74 const T& me,
const SPoint& offset)
const
99 return "A Directed Mover moves move southern atoms to northern empty sites";
116 u32 occupiedCount = 0;
122 const SPoint rel = md.GetPoint(idx);
128 u32 otherType = other.GetType();
132 if(rel.
GetY() < 0 && isOtherEmpty)
134 if (random.
OneIn(++emptyCount))
140 if (rel.
GetY() > 0 && !isOtherEmpty)
142 if (random.
OneIn(++occupiedCount))
149 if (emptyCount > 0 && occupiedCount > 0)
160 Element_Dmover<CC> Element_Dmover<CC>::THE_INSTANCE;
u32 GetFirstIndex(const u32 radius) const
Definition: MDist.h:112
Definition: Element_Empty.h:41
u32 GetLastIndex(const u32 radius) const
Definition: MDist.h:129
virtual u32 PercentMovable(const T &you, const T &me, const SPoint &offset) const
Definition: Element_Dmover.h:73
void SetName(const char *name)
Definition: Element.h:209
void SetAtomicSymbol(const char *symbol)
Definition: Element.h:193
virtual const char * GetDescription() const
Definition: Element_Dmover.h:97
Definition: Element_Dmover.h:42
bool IsLiveSite(const SPoint &location) const
Definition: EventWindow.h:148
bool OneIn(u32 odds)
Definition: Random.h:96
T GetY() const
Definition: Point.tcc:40
Random & GetRandom()
Definition: EventWindow.h:122
const T & GetRelativeAtom(const SPoint &offset) const
Definition: EventWindow.tcc:26
Definition: Parameter.h:593
virtual u32 DefaultLowlightColor() const
Definition: Element_Dmover.h:89
bool IsType(u32 type) const
Definition: Element.h:345
virtual void Behavior(EventWindow< CC > &window) const
Definition: Element_Dmover.h:107
static MDist< R > & get()
Definition: MDist.tcc:193
Definition: ElementTable.h:43
virtual u32 DefaultPhysicsColor() const
Definition: Element_Dmover.h:80
void SwapAtoms(const SPoint &locA, const SPoint &locB)
Definition: EventWindow.tcc:40