source: cpp/tests/genomanipulation-fS-linux.goal @ 1025

Last change on this file since 1025 was 1015, checked in by sz, 4 years ago

test updates:

  • geno_test(.no_exe)
  • linux variants added because of floating point differences
File size: 24.2 KB
Line 
1    #############################################
2   ##                                           ##
3  ##    Welcome to Genotype Manipulation Demo!    ##
4   ##                                           ##
5    #############################################
6Found converter accepting f1: "Recursive encoding"
7Found 6 converter(s) producing f0
8
9Source genotype: '1.1:ssC[S;S;S]{ry=-0.214;ty=0.781}fSC[S;S;*;M'4:-5.154;M'0]fE[M;Gpart]{rx=0.603;ry=-0.9391;rz=0.3034;tx=0.6534;ty=0.6856;tz=-0.166;x=1;z=1}ttC[*;*;Gpart]{st=0.262}fTE{rx=0.603;ry=-0.9391;rz=0.3034;tx=0.6534;ty=0.6856;tz=-0.166;x=1;y=1;z=1}ftC[*;*;N'0'2'3'9'12'14]{ry=-0.199;y=0.828;z=0.806}'
10                  ( format S )
11Converted to f0:
12p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
13p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365
14p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
15p:5.053754302253353, -0.5377665050675111, 2.6620556038997822, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
16p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
17p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
18j:0, 1, sh=1
19j:1, 2, sh=1
20j:2, 3, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
21j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
22j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
23n:p=0, d=S
24n:p=0, d=S
25n:p=0, d=S
26n:p=1, d=S
27n:p=1, d=S
28n:p=1, d=*
29n:j=0, d=M
30n:j=0, d=M
31n:j=1, d=M
32n:p=2, d=Gpart
33n:p=3, d=*
34n:p=3, d=*
35n:p=3, d=Gpart
36n:p=5, d=*
37n:p=5, d=*
38n:p=5
39c:6, 4, -5.154
40c:7, 0
41c:15, 0
42c:15, 2
43c:15, 3
44c:15, 9
45c:15, 12
46c:15, 14
47
48Model contains: 6 part(s)
49                5 joint(s)
50                16 neuron(s)
51
52Investigating details...
53    #############################################
54   ##                                           ##
55  ##    P A R T    O B J E C T                   ##
56   ##                                           ##
57    #############################################
58            (part # 1)
59Here is the full listing of properties as they are printed in f0
60 (please compare with f0 genotype).
61Some properties have special meaning (eg. geometry and connections groups)
62and should be handled with care, because they influence other elements of the model.
63
64 [this data is provided by Part::properties() ]
65 #        id                      type  name        group (22 properties)
66 0.        x = 1.84400826446281     f   position.x  Geometry 
67 1.        y = 0.0                  f   position.y  Geometry 
68 2.        z = 0.0                  f   position.z  Geometry 
69 3.       sh = 2                    d 0 3 0 shape       Geometry 
70 4.        s = 1.0                  f 0.1 10.0 1.0 size        Geometry 
71 5.       sx = 0.9090909090909091   f 0.05 5.0 1.0 scale.x     Geometry 
72 6.       sy = 0.9090909090909091   f 0.05 5.0 1.0 scale.y     Geometry 
73 7.       sz = 0.9090909090909091   f 0.05 5.0 1.0 scale.z     Geometry 
74 8.        h = 0.0                  f 0 1 0 hollow      Other properties
75 9.       dn = 1.0                  f 0.2 5.0 1.0 density     Other properties
7610.       fr = 0.36363636363636365  f 0.0 4.0 0.4 friction    Other properties
7711.      ing = 0.25                 f 0.0 1.0 0.25 ingestion   Other properties
7812.       as = 0.25                 f 0.0 1.0 0.25 assimilation  Other properties
7913.       rx = 0.0                  f   rot.x       Geometry 
8014.       ry = 0.0                  f   rot.y       Geometry 
8115.       rz = 0.0                  f   rot.z       Geometry 
8216.        i =                      s   info        Other properties
8317.   Vstyle = part                 s 0 0 part vis_style   Visual   
8418.       vs = 0.2                  f 0.05 0.7 0.2 visual thickness  Visual   
8519.       vr = 1.0                  f 0.0 1.0 1.0 red component  Visual   
8620.       vg = 1.0                  f 0.0 1.0 1.0 green component  Visual   
8721.       vb = 1.0                  f 0.0 1.0 1.0 blue component  Visual   
88
89However, there is a subset of properties which may be modified more freely.
90Properties on this list are related only to this part and can be changed
91without much consideration. They are guaranteed to be always valid; any inconsistencies
92will be silently repaired.
93
94 [this data is provided by Part::extraProperties() ]
95 #        id                      type  name        group (9 properties)
96 0.        h = 0.0                  f 0 1 0 hollow      Extra properties
97 1.       dn = 1.0                  f 0.2 5.0 1.0 density     Extra properties
98 2.       fr = 0.36363636363636365  f 0.0 4.0 0.4 friction    Extra properties
99 3.      ing = 0.25                 f 0.0 1.0 0.25 ingestion   Extra properties
100 4.       as = 0.25                 f 0.0 1.0 0.25 assimilation  Extra properties
101 5.       vs = 0.2                  f 0.05 0.7 0.2 visual thickness  Extra properties
102 6.       vr = 1.0                  f 0.0 1.0 1.0 red component  Extra properties
103 7.       vg = 1.0                  f 0.0 1.0 1.0 green component  Extra properties
104 8.       vb = 1.0                  f 0.0 1.0 1.0 blue component  Extra properties
105
106This set of properties can vary from release to release,
107but can be safely accessed by using extraProperties() call.
108This method accesses the full set of properies (even those
109which appear in future releases).
110Now we will try to change some of properties:
111
112      Change property #7 to random value from range [0..1]
113      Current value of 'vg' (green component) is '1.0'
114      Setting new value... [ using ParamInterface::set() ]
115      The value is now '0.548814'
116
117Let's see f0... (check out part #1 !)
118
119p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
120p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
121p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
122p:5.053754302253353, -0.5377665050675111, 2.6620556038997822, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
123p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
124p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
125j:0, 1, sh=1
126j:1, 2, sh=1
127j:2, 3, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
128j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
129j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
130n:p=0, d=S
131n:p=0, d=S
132n:p=0, d=S
133n:p=1, d=S
134n:p=1, d=S
135n:p=1, d=*
136n:j=0, d=M
137n:j=0, d=M
138n:j=1, d=M
139n:p=2, d=Gpart
140n:p=3, d=*
141n:p=3, d=*
142n:p=3, d=Gpart
143n:p=5, d=*
144n:p=5, d=*
145n:p=5
146c:6, 4, -5.154
147c:7, 0
148c:15, 0
149c:15, 2
150c:15, 3
151c:15, 9
152c:15, 12
153c:15, 14
154
155    #############################################
156   ##                                           ##
157  ##    J O I N T    O B J E C T                 ##
158   ##                                           ##
159    #############################################
160            (joint # 2)
161Similarly as with Part, the full list of properties comes first:
162
163 #        id                      type  name        group (21 properties)
164 0.       p1 = 2                    d -1 999999 -1 part1 ref#  Connections
165 1.       p2 = 3                    d -1 999999 -1 part2 ref#  Connections
166 2.       sh = 1                    d 0 3 0 shape       Geometry 
167 3.       hx = 0.0                  f   hinge position.x  Geometry 
168 4.       hy = 0.0                  f   hinge position.y  Geometry 
169 5.       hz = 0.0                  f   hinge position.z  Geometry 
170 6.      hrx = 0.0                  f   hinge rotation.x  Geometry 
171 7.      hry = 0.0                  f   hinge rotation.y  Geometry 
172 8.      hrz = 0.0                  f   hinge rotation.z  Geometry 
173 9.      hxn = -1.5708              f -6.2832 0 -1.5708 hinge x negative limit  Geometry 
17410.      hxp = 1.5708               f 0 6.2832 1.5708 hinge x positive limit  Geometry 
17511.      hyn = -1.5708              f -6.2832 0 -1.5708 hinge y negative limit  Geometry 
17612.      hyp = 1.5708               f 0 6.2832 1.5708 hinge y positive limit  Geometry 
17713.     stif = 0.2165289256198347   f 0.0 1.0 1.0 stiffness   Other properties
17814.  rotstif = 0.2165289256198347   f 0.0 1.0 1.0 rotation stiffness  Other properties
17915.     stam = 0.25                 f 0.0 1.0 0.25 stamina     Other properties
18016.        i =                      s   info        Other properties
18117.   Vstyle = joint                s 0 0 joint vis_style   Visual   
18218.       vr = 1.0                  f 0.0 1.0 1.0 red component  Visual   
18319.       vg = 1.0                  f 0.0 1.0 1.0 green component  Visual   
18420.       vb = 1.0                  f 0.0 1.0 1.0 blue component  Visual   
185
186Actually, there are two kinds of Joints: delta and absolute.
187For this object, Joint::isDelta() returns 0, so this is the absolute Joint.
188
189Absolute Joints adapt to its Parts' positions.
190We can move a Part, and it does not influence the second part, nor the Joint.
191Let's move the first Part along y axis by -0.1...
192The Part's position is changed, but everything else stays intact:
193
194p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
195p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
196p:3.4488812833580815, -0.36888325253375553, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
197p:5.053754302253353, -0.5377665050675111, 2.6620556038997822, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
198p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
199p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
200j:0, 1, sh=1
201j:1, 2, sh=1
202j:2, 3, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
203j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
204j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
205n:p=0, d=S
206n:p=0, d=S
207n:p=0, d=S
208n:p=1, d=S
209n:p=1, d=S
210n:p=1, d=*
211n:j=0, d=M
212n:j=0, d=M
213n:j=1, d=M
214n:p=2, d=Gpart
215n:p=3, d=*
216n:p=3, d=*
217n:p=3, d=Gpart
218n:p=5, d=*
219n:p=5, d=*
220n:p=5
221c:6, 4, -5.154
222c:7, 0
223c:15, 0
224c:15, 2
225c:15, 3
226c:15, 9
227c:15, 12
228c:15, 14
229
230How would this joint look like with delta option enabled?
231[ by calling Joint::useDelta(1) ]
232f0 is now:
233
234p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
235p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
236p:3.4488812833580815, -0.36888325253375553, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
237p:5.053754302253353, -0.537766505067511, 2.6620556038997822, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
238p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
239p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
240j:0, 1, sh=1
241j:1, 2, sh=1
242j:2, 3, rx=-0.6137069589668486, 0.9336120115153849, 0.32629609148341426, dx=1.6048730188952711, -0.16888325253375558, 1.3310278019498911, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
243j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
244j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
245n:p=0, d=S
246n:p=0, d=S
247n:p=0, d=S
248n:p=1, d=S
249n:p=1, d=S
250n:p=1, d=*
251n:j=0, d=M
252n:j=0, d=M
253n:j=1, d=M
254n:p=2, d=Gpart
255n:p=3, d=*
256n:p=3, d=*
257n:p=3, d=Gpart
258n:p=5, d=*
259n:p=5, d=*
260n:p=5
261c:6, 4, -5.154
262c:7, 0
263c:15, 0
264c:15, 2
265c:15, 3
266c:15, 9
267c:15, 12
268c:15, 14
269
270...so this is a delta joint.
271
272Delta fields (dx,dy,dz) describe relative location of the second part.
273This joint will change the second Part's positions to preserve delta distance.
274Let's move the first Part (#2) along y axis (+0.1) and change delta.z (dz) by 0.1.
275Position of the second Part referenced by this joint (part #3) is now changed:
276
277p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
278p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
279p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
280p:5.053754302253353, -0.437766505067511, 2.762055603899782, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
281p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
282p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
283j:0, 1, sh=1
284j:1, 2, sh=1
285j:2, 3, rx=-0.6137069589668486, 0.9336120115153849, 0.32629609148341426, dx=1.6048730188952711, -0.16888325253375558, 1.4310278019498912, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
286j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
287j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
288n:p=0, d=S
289n:p=0, d=S
290n:p=0, d=S
291n:p=1, d=S
292n:p=1, d=S
293n:p=1, d=*
294n:j=0, d=M
295n:j=0, d=M
296n:j=1, d=M
297n:p=2, d=Gpart
298n:p=3, d=*
299n:p=3, d=*
300n:p=3, d=Gpart
301n:p=5, d=*
302n:p=5, d=*
303n:p=5
304c:6, 4, -5.154
305c:7, 0
306c:15, 0
307c:15, 2
308c:15, 3
309c:15, 9
310c:15, 12
311c:15, 14
312
313If no delta fields are defined, they will be computed automatically.
314You can always delete existing delta values by using Joint::resetDelta().
315Now we will change the second Part's z position by -0.2 and call resetDelta()...
316As you can see, Joint's delta fields have altered:
317
318p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
319p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
320p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
321p:5.053754302253353, -0.437766505067511, 2.5620556038997817, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
322p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
323p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
324j:0, 1, sh=1
325j:1, 2, sh=1
326j:2, 3, rx=-0.6137069589668486, 0.9336120115153849, 0.32629609148341426, dx=1.6048730188952707, -0.16888325253375555, 1.2310278019498904, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
327j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
328j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
329n:p=0, d=S
330n:p=0, d=S
331n:p=0, d=S
332n:p=1, d=S
333n:p=1, d=S
334n:p=1, d=*
335n:j=0, d=M
336n:j=0, d=M
337n:j=1, d=M
338n:p=2, d=Gpart
339n:p=3, d=*
340n:p=3, d=*
341n:p=3, d=Gpart
342n:p=5, d=*
343n:p=5, d=*
344n:p=5
345c:6, 4, -5.154
346c:7, 0
347c:15, 0
348c:15, 2
349c:15, 3
350c:15, 9
351c:15, 12
352c:15, 14
353
354Part references and delta fields are the 'core' properties of the Joint.
355The other properties are available from Joint::extraProperties()
356and at the moment are defined as follows:
357
358 #        id                      type  name        group (5 properties)
359 0.     stif = 0.2165289256198347   f 0.0 1.0 1.0 stiffness   Extra properties
360 1.  rotstif = 0.2165289256198347   f 0.0 1.0 1.0 rotation stiffness  Extra properties
361 2.       vr = 1.0                  f 0.0 1.0 1.0 red component  Extra properties
362 3.       vg = 1.0                  f 0.0 1.0 1.0 green component  Extra properties
363 4.       vb = 1.0                  f 0.0 1.0 1.0 blue component  Extra properties
364
365They can be changed just like Part's extra properties:
366      Change property #0 to random value from range [0..1]
367      Current value of 'stif' (stiffness) is '0.2165289256198347'
368      Setting new value... [ using ParamInterface::set() ]
369      The value is now '0.592845'
370And after that we have this genotype:
371
372p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
373p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
374p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
375p:5.053754302253352, -0.437766505067511, 2.5620556038997813, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
376p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
377p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
378j:0, 1, sh=1
379j:1, 2, sh=1
380j:2, 3, rx=-0.6137069589668486, 0.9336120115153849, 0.32629609148341426, dx=1.6048730188952707, -0.16888325253375555, 1.2310278019498904, sh=1, stif=0.592845, rotstif=0.2165289256198347
381j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
382j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
383n:p=0, d=S
384n:p=0, d=S
385n:p=0, d=S
386n:p=1, d=S
387n:p=1, d=S
388n:p=1, d=*
389n:j=0, d=M
390n:j=0, d=M
391n:j=1, d=M
392n:p=2, d=Gpart
393n:p=3, d=*
394n:p=3, d=*
395n:p=3, d=Gpart
396n:p=5, d=*
397n:p=5, d=*
398n:p=5
399c:6, 4, -5.154
400c:7, 0
401c:15, 0
402c:15, 2
403c:15, 3
404c:15, 9
405c:15, 12
406c:15, 14
407
408    #############################################
409   ##                                           ##
410  ##    N E U R O    O B J E C T                 ##
411   ##                                           ##
412    #############################################
413            (neuro # 1)
414Basic features of Neuro object are similar to those of Part and Joint.
415We can request a property list:
416
417 #        id                      type  name        group (10 properties)
418 0.        p = 0                    d -1 999999 -1 part ref#   Connections
419 1.        j = -1                   d -1 999999 -1 joint ref#  Connections
420 2.        d = S                    s   details     Other     
421 3.        i =                      s   info        Other     
422 4.   Vstyle = neuro                s 0 0 neuro vis_style   Visual   
423 5. getInputCount = 0                    d   input count  Connections
424 9. classObject = null                 oNeuroClass neuron class  Connections
425
426...and extra properties (which are designed to be always valid and easy to change):
427
428 #        id                      type  name        group (0 properties)
429
430As usual, we will change something:
431Each neuron can have any number of inputs = weighted connections
432 with other neurons.
433According to Neuro::getInputCount(), this one has 0 inputs.
434Standard API is provided for accessing those inputs (getInput(int)),
435adding inputs (addInput(Neuro*)) and removing them (removeInput(int)).
436
437
438The most unusual thing is 'details' field (d).
439It is something like separate object with its own set of properties.
440Currently the value of 'd' is 'S'.
441'S' is the class name (Neuro::getClassName() == 'S') and means 'Smell'.
442Neuro::getClass() gives you information about basic characteristic
443of the class, that can be analyzed automatically.
444For the current object we can learn that it supports no inputs (getPreferredInputs()) and provides meaningful output signal (getPreferredOutput()==1).
445Instances of 'S' can be used in models having any shape types.
446Instances of 'S' can be attached to Parts.
447(This class does not have its own properties
448 - Neuro::classProperties().getPropCount()==0)
449The class of this object can be changed using Neuro::setClassName()
450The following classes are available:
451 [ data provided by Neuro::getClassInfo()->getProperties() ]
452
453 #  class  description       properties
454 0.     N  Neuron                 4
455 1.    Nu  Unipolar neuron [EXPERIMENTAL!]   4
456 2.     G  Gyroscope              0
457 3. Gpart  Part Gyroscope         2
458 4.     T  Touch                  3
459 5.Tcontact  Touch contact          0
460 6.Tproximity  Touch proximity        3
461 7.     S  Smell                  0
462 8.     *  Constant               0
463 9.     |  Bend muscle            2
46410.     @  Rotation muscle        1
46511.     M  Muscle for solids      2
46612.     D  Differentiate          0
46713. Fuzzy  Fuzzy system [EXPERIMENTAL!]   4
46814.   Sti  Sticky [EXPERIMENTAL!]   0
46915.   LMu  Linear muscle [EXPERIMENTAL!]   1
47016. Water  Water detector         0
47117.Energy  Energy level           0
47218.    Ch  Channelize             0
47319. ChMux  Channel multiplexer    0
47420. ChSel  Channel selector       1
47521.   Rnd  Random noise           0
47622.   Sin  Sinus generator        2
477
478Let's change the Neuro's class to 'N'...
479 #        id                      type  name        group (4 properties)
480 0.       in = 0.8                  f 0.0 1.0 0.8 Inertia     (null)   
481 1.       fo = 0.04                 f 0.0 999.0 0.04 Force       (null)   
482 2.       si = 2.0                  f -99999.0 99999.0 2.0 Sigmoid     (null)   
483 3.        s = 0.0                  f -1.0 1.0 0.0 State       (null)   
484      Change property #2 to random value from range [-99999..99999]
485      Current value of 'si' (Sigmoid) is '2.0'
486      Setting new value... [ using ParamInterface::set() ]
487      The value is now '43037.4'
488The final object description will be then: 'N:si=43037.4'
489And the full f0 genotype:
490
491p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
492p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365, vg=0.548814
493p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
494p:5.053754302253352, -0.437766505067511, 2.5620556038997813, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
495p:5.55205906721839, -1.6581236294201596, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
496p:5.983025350431395, -2.627081142373801, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
497j:0, 1, sh=1
498j:1, 2, sh=1
499j:2, 3, rx=-0.6137069589668486, 0.9336120115153849, 0.32629609148341426, dx=1.6048730188952707, -0.16888325253375555, 1.2310278019498904, sh=1, stif=0.592845, rotstif=0.2165289256198347
500j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
501j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
502n:p=0, d=S
503n:p=0, d=N:si=43037.4
504n:p=0, d=S
505n:p=1, d=S
506n:p=1, d=S
507n:p=1, d=*
508n:j=0, d=M
509n:j=0, d=M
510n:j=1, d=M
511n:p=2, d=Gpart
512n:p=3, d=*
513n:p=3, d=*
514n:p=3, d=Gpart
515n:p=5, d=*
516n:p=5, d=*
517n:p=5
518c:6, 4, -5.154
519c:7, 0
520c:15, 0
521c:15, 2
522c:15, 3
523c:15, 9
524c:15, 12
525c:15, 14
526
527
528######### THE END ###########
529
530Hints:
531  1. You can redirect output: genomanipulation >filename.txt
532  2. Each run can yield different results and new behaviors, but you
533     need to uncomment srand(time(0)) in genomanipulation.cpp.
534  3. This application will use custom genotype passed as
535     a commandline parameter: genomanipulation "/*9*/FULU"
536
537
Note: See TracBrowser for help on using the repository browser.