1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
3 | <title>geno_fx.h Source File</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | </head><body> |
---|
6 | <!-- Generated by Doxygen 1.2.17 --> |
---|
7 | <center> |
---|
8 | <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> |
---|
9 | <hr><h1>geno_fx.h</h1><a href="geno__fx_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// This file is a part of Framsticks GenoFX library.</span> |
---|
10 | 00002 <span class="comment">// Copyright (C) 2002 Maciej Komosinski. See LICENSE.txt for details.</span> |
---|
11 | 00003 <span class="comment">// Refer to http://www.frams.alife.pl/ for further information.</span> |
---|
12 | 00004 |
---|
13 | 00005 <span class="preprocessor">#ifndef _GENO_FX_H_</span> |
---|
14 | 00006 <span class="preprocessor"></span><span class="preprocessor">#define _GENO_FX_H_</span> |
---|
15 | 00007 <span class="preprocessor"></span> |
---|
16 | 00008 <span class="preprocessor">#include "nonstd.h"</span> |
---|
17 | 00009 <span class="preprocessor">#include "modelparts.h"</span> |
---|
18 | 00010 |
---|
19 | <a name="l00015"></a><a class="code" href="geno__fx_8h.html#a0">00015</a> <span class="preprocessor">#define GENOPER_OK 0 </span> |
---|
20 | <a name="l00016"></a><a class="code" href="geno__fx_8h.html#a1">00016</a> <span class="preprocessor">#define GENOPER_OPFAIL -1 </span> |
---|
21 | <a name="l00017"></a><a class="code" href="geno__fx_8h.html#a2">00017</a> <span class="preprocessor">#define GENOPER_REPAIR -2 </span> |
---|
22 | <a name="l00018"></a><a class="code" href="geno__fx_8h.html#a3">00018</a> <span class="preprocessor">#define GENOPER_NOOPER -3 </span> |
---|
23 | 00019 <span class="preprocessor"></span> |
---|
24 | 00020 <span class="preprocessor"></span> |
---|
25 | 00021 <span class="preprocessor"></span> |
---|
26 | <a name="l00023"></a><a class="code" href="geno__fx_8h.html#a4">00023</a> <span class="preprocessor">#define GENSTYLE_NONE 0 </span> |
---|
27 | <a name="l00024"></a><a class="code" href="geno__fx_8h.html#a5">00024</a> <span class="preprocessor">#define GENSTYLE_INVALID 1 </span> |
---|
28 | <a name="l00025"></a><a class="code" href="geno__fx_8h.html#a6">00025</a> <span class="preprocessor">#define GENSTYLE_BOLD 2 </span> |
---|
29 | <a name="l00026"></a><a class="code" href="geno__fx_8h.html#a7">00026</a> <span class="preprocessor">#define GENSTYLE_ITALIC 4 </span> |
---|
30 | <a name="l00027"></a><a class="code" href="geno__fx_8h.html#a8">00027</a> <span class="preprocessor">#define GENSTYLE_STRIKEOUT 8 </span> |
---|
31 | 00028 <span class="preprocessor">//UNDERLINE used to mark errors</span> |
---|
32 | 00029 <span class="preprocessor"></span> |
---|
33 | 00030 |
---|
34 | 00033 <span class="preprocessor">#define GENRGB(r,g,b) ((unsigned long)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned long)(unsigned char)(b))<<16)))</span> |
---|
35 | 00034 <span class="preprocessor"></span><span class="preprocessor">#define GENSTYLE_RGBS(r,g,b,s) ((unsigned long)((unsigned char)s)<<24 | GENRGB(r,g,b))</span> |
---|
36 | 00035 <span class="preprocessor"></span><span class="preprocessor">#define GENSTYLE_CS(rgb,s) ((unsigned long)((unsigned char)s)<<24 | rgb)</span> |
---|
37 | 00036 <span class="preprocessor"></span> |
---|
38 | 00037 <span class="preprocessor">#define GENGETSTYLE(style) ((style)>>24)</span> |
---|
39 | 00038 <span class="preprocessor"></span><span class="preprocessor">#define GENGETCOLOR(style) ((style)&0x00ffffff)</span> |
---|
40 | 00039 <span class="preprocessor"></span> |
---|
41 | <a name="l00040"></a><a class="code" href="geno__fx_8h.html#a14">00040</a> <span class="preprocessor">#define GENCOLOR_TEXT GENRGB(0,0,0) </span> |
---|
42 | <a name="l00041"></a><a class="code" href="geno__fx_8h.html#a15">00041</a> <span class="preprocessor">#define GENCOLOR_NUMBER GENRGB(200,0,0) </span> |
---|
43 | 00042 <span class="preprocessor"></span> |
---|
44 | 00043 <span class="preprocessor"></span> |
---|
45 | 00044 <span class="preprocessor"></span> |
---|
46 | 00045 |
---|
47 | <a name="l00075"></a><a class="code" href="classGeno__fx.html">00075</a> <span class="keyword">class </span><a class="code" href="classGeno__fx.html">Geno_fx</a> |
---|
48 | 00076 { |
---|
49 | 00077 <span class="keyword">public</span>: |
---|
50 | 00078 Param par; |
---|
51 | <a name="l00079"></a><a class="code" href="classGeno__fx.html#m1">00079</a> <span class="keywordtype">char</span> <a class="code" href="classGeno__fx.html#m1">supported_format</a>; |
---|
52 | <a name="l00080"></a><a class="code" href="classGeno__fx.html#m2">00080</a> SString <a class="code" href="classGeno__fx.html#m2">name</a>; |
---|
53 | 00081 <a class="code" href="classGeno__fx.html">Geno_fx</a>() : par(empty_paramtab) {<a class="code" href="classGeno__fx.html#m1">supported_format</a>=<span class="charliteral">'x'</span>; <a class="code" href="classGeno__fx.html#m2">name</a>=<span class="stringliteral">"Default"</span>;} |
---|
54 | 00082 |
---|
55 | <a name="l00087"></a><a class="code" href="classGeno__fx.html#a1">00087</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#a1">checkValidity</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *geno) {<span class="keywordflow">return</span> <a class="code" href="geno__fx_8h.html#a3">GENOPER_NOOPER</a>;} |
---|
56 | 00088 |
---|
57 | <a name="l00094"></a><a class="code" href="classGeno__fx.html#a2">00094</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#a2">validate</a>(<span class="keywordtype">char</span> *&geno) {<span class="keywordflow">return</span> <a class="code" href="geno__fx_8h.html#a3">GENOPER_NOOPER</a>;} |
---|
58 | 00095 |
---|
59 | <a name="l00127"></a><a class="code" href="classGeno__fx.html#a3">00127</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#a3">mutate</a>(<span class="keywordtype">char</span> *&geno,<span class="keywordtype">float</span>& chg) {<span class="keywordflow">return</span> <a class="code" href="geno__fx_8h.html#a3">GENOPER_NOOPER</a>;} |
---|
60 | 00128 |
---|
61 | <a name="l00144"></a><a class="code" href="classGeno__fx.html#a4">00144</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#a4">crossOver</a>(<span class="keywordtype">char</span> *&g1,<span class="keywordtype">char</span> *&g2,<span class="keywordtype">float</span>& chg1,<span class="keywordtype">float</span>& chg2) {<span class="keywordflow">return</span> <a class="code" href="geno__fx_8h.html#a3">GENOPER_NOOPER</a>;} |
---|
62 | 00145 |
---|
63 | <a name="l00147"></a><a class="code" href="classGeno__fx.html#a5">00147</a> <span class="keyword">virtual</span> <span class="keywordtype">char</span>* <a class="code" href="classGeno__fx.html#a5">getSimplest</a>() {<span class="keywordflow">return</span> NULL;} |
---|
64 | 00148 |
---|
65 | <a name="l00155"></a><a class="code" href="classGeno__fx.html#a6">00155</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classGeno__fx.html#a6">style</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *geno,<span class="keywordtype">int</span> pos) {<span class="keywordflow">return</span> GENSTYLE_RGBS(0,0,0,<a class="code" href="geno__fx_8h.html#a4">GENSTYLE_NONE</a>);} |
---|
66 | 00156 |
---|
67 | <a name="l00158"></a><a class="code" href="classGeno__fx.html#a7">00158</a> <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="classGeno__fx.html#a7">similarity</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*,<span class="keyword">const</span> <span class="keywordtype">char</span>*) {<span class="keywordflow">return</span> <a class="code" href="geno__fx_8h.html#a3">GENOPER_NOOPER</a>;} |
---|
68 | 00159 <span class="keyword">virtual</span> ~<a class="code" href="classGeno__fx.html">Geno_fx</a>() {} |
---|
69 | 00160 <span class="comment">// virtual char getFormat() {return 255;} //returns supported genotype format, for ex. '1'</span> |
---|
70 | 00161 <span class="comment">// virtual int enabled() {return 1;} // should be enabled by default</span> |
---|
71 | 00162 |
---|
72 | 00165 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#z7_0">roulette</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *probtab,<span class="keywordtype">int</span> count); |
---|
73 | 00166 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classGeno__fx.html#z7_1">getMinMaxDef</a>(ParamInterface *p,<span class="keywordtype">int</span> propindex,<span class="keywordtype">double</span> &mn,<span class="keywordtype">double</span> &mx,<span class="keywordtype">double</span> &def); |
---|
74 | 00167 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#z7_2">selectRandomProperty</a>(Neuro* n); |
---|
75 | 00168 <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classGeno__fx.html#z7_3">mutateNeuProperty</a>(<span class="keywordtype">double</span> current,Neuro *n,<span class="keywordtype">int</span> propindex); |
---|
76 | 00169 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classGeno__fx.html#z7_4">mutateProperty</a>(ParamInterface &p,<span class="keywordtype">int</span> propindex); |
---|
77 | 00170 <span class="keyword">static</span> <span class="keywordtype">double</span> <a class="code" href="classGeno__fx.html#z7_5">mutateValue</a>(<span class="keywordtype">double</span> current,<span class="keywordtype">double</span> vmin,<span class="keywordtype">double</span> vmax); |
---|
78 | 00171 <span class="keyword">static</span> NeuroClass* <a class="code" href="classGeno__fx.html#z7_6">getRandomNeuroClass</a>(); |
---|
79 | 00172 <span class="keyword">static</span> NeuroClass* <a class="code" href="classGeno__fx.html#z7_7">parseNeuroClass</a>(<span class="keywordtype">char</span> *&s); |
---|
80 | 00173 <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classGeno__fx.html#z7_8">neuroClassProp</a>(<span class="keywordtype">char</span> *&s,NeuroClass *nc,<span class="keywordtype">bool</span> also_v1_N_props=<span class="keyword">false</span>); |
---|
81 | 00174 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classGeno__fx.html#z7_9">isWS</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> c); |
---|
82 | 00175 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classGeno__fx.html#z7_10">skipWS</a>(<span class="keywordtype">char</span> *&s); |
---|
83 | 00176 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classGeno__fx.html#z7_11">areAlike</a>(<span class="keywordtype">char</span>*,<span class="keywordtype">char</span>*); |
---|
84 | 00177 <span class="keyword">static</span> <span class="keywordtype">char</span>* <a class="code" href="classGeno__fx.html#z7_12">strchrn0</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *str,<span class="keywordtype">char</span> ch); |
---|
85 | 00178 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classGeno__fx.html#z7_13">isNeuroClassName</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> firstchar); |
---|
86 | 00179 |
---|
87 | 00180 }; |
---|
88 | 00181 |
---|
89 | 00182 |
---|
90 | 00183 <span class="preprocessor">#endif</span> |
---|
91 | 00184 <span class="preprocessor"></span> |
---|
92 | </pre></div><hr><address style="align: right;"><small>Generated on Sun Sep 15 00:58:39 2002 for Framsticks GenoFX by |
---|
93 | <a href="http://www.doxygen.org/index.html"> |
---|
94 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 |
---|
95 | width=110 height=53></a>1.2.17 </small></address> |
---|
96 | </body> |
---|
97 | </html> |
---|