Changeset 1033 for cpp/tests/genomanipulation-default.goal
- Timestamp:
- 11/28/20 17:38:03 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/tests/genomanipulation-default.goal
r1009 r1033 42 42 3. sh = 0 d 0 3 0 shape Geometry 43 43 4. s = 1.0 f 0.1 10.0 1.0 size Geometry 44 5. sx = 1.0 f 0.0 01 1000.0 1.0 scale.x Geometry45 6. sy = 1.0 f 0.0 01 1000.0 1.0 scale.y Geometry46 7. sz = 1.0 f 0.0 01 1000.0 1.0 scale.z Geometry44 5. sx = 1.0 f 0.05 5.0 1.0 scale.x Geometry 45 6. sy = 1.0 f 0.05 5.0 1.0 scale.y Geometry 46 7. sz = 1.0 f 0.05 5.0 1.0 scale.z Geometry 47 47 8. h = 0.0 f 0 1 0 hollow Other properties 48 48 9. dn = 1.0 f 0.2 5.0 1.0 density Other properties … … 83 83 Now we will try to change some of properties: 84 84 85 Change property # 0 to random value from range [0..1]86 Current value of ' h' (hollow) is '0.0'85 Change property #5 to random value from range [0.05..0.7] 86 Current value of 'vs' (visual thickness) is '0.2' 87 87 Setting new value... [ using ParamInterface::set() ] 88 The value is now '0.5 48814'88 The value is now '0.514873' 89 89 90 90 Let's see f0... (check out part #1 !) 91 91 92 92 p:vr=0.5, 0.5, 0.5 93 p:1.0, h=0.548814, vr=0.5, 0.5, 0.593 p:1.0, vs=0.514873, vr=0.5, 0.5, 0.5 94 94 j:0, 1, dx=1.0, 0.0, 0.0, vr=0.5, 0.5, 0.5 95 95 n:p=1 … … 145 145 146 146 p:y=0.1, vr=0.5, 0.5, 0.5 147 p:1.0, 0.1, 0.1, h=0.548814, vr=0.5, 0.5, 0.5147 p:1.0, 0.1, 0.1, vs=0.514873, vr=0.5, 0.5, 0.5 148 148 j:0, 1, dx=1.0, 0.0, 0.1, vr=0.5, 0.5, 0.5 149 149 n:p=1 … … 159 159 160 160 p:y=0.1, vr=0.5, 0.5, 0.5 161 p:1.0, 0.1, -0.1, h=0.548814, vr=0.5, 0.5, 0.5161 p:1.0, 0.1, -0.1, vs=0.514873, vr=0.5, 0.5, 0.5 162 162 j:0, 1, dx=1.0, 0.0, -0.1, vr=0.5, 0.5, 0.5 163 163 n:p=1 … … 172 172 173 173 p:y=0.1, vr=0.5, 0.5, 0.5 174 p:1.0, 0.1, -0.1, h=0.548814, vr=0.5, 0.5, 0.5174 p:1.0, 0.1, -0.1, vs=0.514873, vr=0.5, 0.5, 0.5 175 175 j:0, 1, vr=0.5, 0.5, 0.5 176 176 n:p=1 … … 188 188 189 189 p:vr=0.5, 0.5, 0.5 190 p:1.0, 0.1, -0.1, h=0.548814, vr=0.5, 0.5, 0.5190 p:1.0, 0.1, -0.1, vs=0.514873, vr=0.5, 0.5, 0.5 191 191 j:0, 1, vr=0.5, 0.5, 0.5 192 192 n:p=1 … … 208 208 209 209 They can be changed just like Part's extra properties: 210 Change property # 4to random value from range [0..1]211 Current value of 'v b' (bluecomponent) is '0.5'210 Change property #3 to random value from range [0..1] 211 Current value of 'vg' (green component) is '0.5' 212 212 Setting new value... [ using ParamInterface::set() ] 213 The value is now '0. 592845'213 The value is now '0.857946' 214 214 And after that we have this genotype: 215 215 216 216 p:vr=0.5, 0.5, 0.5 217 p:1.0, 0.1, -0.1, h=0.548814, vr=0.5, 0.5, 0.5218 j:0, 1, vr=0.5, 0. 5, 0.592845217 p:1.0, 0.1, -0.1, vs=0.514873, vr=0.5, 0.5, 0.5 218 j:0, 1, vr=0.5, 0.857946, 0.5 219 219 n:p=1 220 220 n:j=0, d="|:p=0.25,r=1" … … 228 228 ## ## 229 229 ############################################# 230 (neuro # 0)230 (neuro # 1) 231 231 Basic features of Neuro object are similar to those of Part and Joint. 232 232 We can request a property list: 233 233 234 234 # id type name group (10 properties) 235 0. p = 1d -1 999999 -1 part ref# Connections236 1. j = -1d -1 999999 -1 joint ref# Connections237 2. d = Ns details Other235 0. p = -1 d -1 999999 -1 part ref# Connections 236 1. j = 0 d -1 999999 -1 joint ref# Connections 237 2. d = |:p=0.25,r=1 s details Other 238 238 3. i = s info Other 239 239 4. Vstyle = neuro s 0 0 neuro vis_style Visual … … 255 255 The most unusual thing is 'details' field (d). 256 256 It is something like separate object with its own set of properties. 257 Currently the value of 'd' is ' N'.258 ' N' is the class name (Neuro::getClassName() == 'N') and means 'Neuron'.257 Currently the value of 'd' is '|:p=0.25,r=1'. 258 '|' is the class name (Neuro::getClassName() == '|') and means 'Bend muscle'. 259 259 Neuro::getClass() gives you information about basic characteristic 260 260 of the class, that can be analyzed automatically. 261 For the current object we can learn that it supports any number of inputs (getPreferredInputs()) and provides meaningful output signal (getPreferredOutput()==1). 262 Instances of 'N' can be used in models having any shape types. 261 For the current object we can learn that it supports 1 inputs (getPreferredInputs()) and doesn't provide useful output signal (getPreferredOutput()==0). 262 Instances of '|' can be used in models having shape types: 'ball-and-stick'. 263 Instances of '|' can be attached to Joints having any shapes. 263 264 The class defines its own properties: 264 265 265 266 [ data provided by Neuro::classProperties() ] 266 # id type name group (4 properties) 267 0. in = 0.8 f 0.0 1.0 0.8 Inertia (null) 268 1. fo = 0.04 f 0.0 999.0 0.04 Force (null) 269 2. si = 2.0 f -99999.0 99999.0 2.0 Sigmoid (null) 270 3. s = 0.0 f -1.0 1.0 0.0 State (null) 267 # id type name group (2 properties) 268 0. p = 0.25 f 0.01 1.0 0.25 power Bend muscle 269 1. r = 1.0 f 0.0 1.0 1.0 bending range Bend muscle 271 270 and they can be changed: 272 Change property # 0to random value from range [0..1]273 Current value of ' in' (Inertia) is '0.8'271 Change property #1 to random value from range [0..1] 272 Current value of 'r' (bending range) is '1.0' 274 273 Setting new value... [ using ParamInterface::set() ] 275 The value is now '0. 715189'276 After that, 'details' contains the new object: ' N:in=0.715189'.274 The value is now '0.423655' 275 After that, 'details' contains the new object: '|:r=0.423655'. 277 276 The class of this object can be changed using Neuro::setClassName() 278 277 The following classes are available: … … 304 303 22. Sin Sinus generator 2 305 304 306 Let's change the Neuro's class to ' Water'...307 [WARN] Param.loadSingleLine: Unknown property ' Water.in' (ignored)305 Let's change the Neuro's class to 'Sti'... 306 [WARN] Param.loadSingleLine: Unknown property 'Sti.r' (ignored) 308 307 Info for input #0 = "" 309 308 Info for input #0, field "abc" = "" 310 The final object description will be then: ' Water'309 The final object description will be then: 'Sti' 311 310 And the full f0 genotype: 312 311 313 312 p:vr=0.5, 0.5, 0.5 314 p:1.0, 0.1, -0.1, h=0.548814, vr=0.5, 0.5, 0.5315 j:0, 1, vr=0.5, 0. 5, 0.592845316 n:p=1 , d=Water317 n:j=0, d= "|:p=0.25,r=1"318 n:j=0, d=G 319 c:0, 2, 1.23 , i="test=44,abc=yeah"320 c:1, 0 313 p:1.0, 0.1, -0.1, vs=0.514873, vr=0.5, 0.5, 0.5 314 j:0, 1, vr=0.5, 0.857946, 0.5 315 n:p=1 316 n:j=0, d=Sti 317 n:j=0, d=G 318 c:0, 2, 1.23 319 c:1, 0, i="test=44,abc=yeah" 321 320 322 321 … … 326 325 1. You can redirect output: genomanipulation >filename.txt 327 326 2. Each run can yield different results and new behaviors, but you 328 need to uncomment srand(time(0)) in genomanipulation.cpp.327 need to uncomment rndRandomizeSeed() in genomanipulation.cpp. 329 328 3. This application will use custom genotype passed as 330 329 a commandline parameter: genomanipulation "/*9*/FULU"
Note: See TracChangeset
for help on using the changeset viewer.