27 #ifndef ELEMENT_FISH_H
28 #define ELEMENT_FISH_H
45 typedef typename CC::ATOM_TYPE T;
46 typedef typename CC::PARAM_CONFIG P;
48 R = P::EVENT_WINDOW_RADIUS,
50 INITIAL_DEFAULT_BIRTH_AGE = 20
63 static const u32 TYPE()
70 m_fishBirthAge(
this,
"age",
"Birth Age",
71 "Number of events for a fish to mature",
72 1, INITIAL_DEFAULT_BIRTH_AGE, 100),
73 m_fishEvolve(
this,
"evo",
"Evolvable fish",
74 "Is fish birth age set by mutable genes?",
83 static T defaultAtom(TYPE(),0,0,0);
85 this->SetBirthAge(defaultAtom, (u32) m_fishBirthAge.GetValue());
86 this->SetCurrentAge(defaultAtom, 0);
103 const T& me,
const SPoint& offset)
const
113 u32 age = this->GetCurrentAge(
self);
117 bool reproable = age >= (u32) m_fishBirthAge.GetValue();
121 this->SetCurrentAge(
self, 1 + age);
130 this->SetCurrentAge(
self,0);
150 Element_Fish<CC> Element_Fish<CC>::THE_INSTANCE;
u32 GetType() const
Definition: Element.h:290
Definition: Element_Empty.h:41
void SetCenterAtom(const T &atom)
Definition: EventWindow.h:220
bool Equals(const Point< T > &rhs) const
Definition: Point.tcc:205
Definition: Parameter.h:628
void SetName(const char *name)
Definition: Element.h:209
void SetAtomicSymbol(const char *symbol)
Definition: Element.h:193
u32 FindEmptyInVonNeumann(SPoint &outPoint) const
Definition: WindowScanner.tcc:311
virtual u32 Diffusability(EventWindow< CC > &ew, SPoint nowAt, SPoint maybeAt) const
Definition: Element_Fish.h:97
Definition: Parameter.h:593
const T & GetCenterAtom() const
Definition: EventWindow.h:209
Definition: AbstractElement_WaPat.h:39
Definition: Element_Fish.h:42
virtual const T & GetDefaultAtom() const
Definition: Element_Fish.h:81
Definition: ElementTable.h:43
virtual void Behavior(EventWindow< CC > &window) const
Definition: Element_Fish.h:108
Definition: WindowScanner.h:40
bool SetRelativeAtom(const SPoint &offset, const T &atom)
Definition: EventWindow.tcc:15
virtual u32 PercentMovable(const T &you, const T &me, const SPoint &offset) const
Definition: Element_Fish.h:102
virtual u32 DefaultPhysicsColor() const
Definition: Element_Fish.h:91