Changeset 1033 for cpp/tests/genomanipulation-complex.goal
- Timestamp:
- 11/28/20 17:38:03 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/tests/genomanipulation-complex.goal
r1009 r1033 29 29 ## ## 30 30 ############################################# 31 (part # 2)31 (part # 1) 32 32 Here is the full listing of properties as they are printed in f0 33 33 (please compare with f0 genotype). … … 37 37 [this data is provided by Part::properties() ] 38 38 # id type name group (22 properties) 39 0. x = 2.0 f position.x Geometry39 0. x = 1.0 f position.x Geometry 40 40 1. y = 0.0 f position.y Geometry 41 41 2. z = 0.0 f position.z Geometry 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 49 10. fr = 0.976f 0.0 4.0 0.4 friction Other properties50 11. ing = 0. 475f 0.0 1.0 0.25 ingestion Other properties51 12. as = 0.1 75f 0.0 1.0 0.25 assimilation Other properties49 10. fr = 1.12 f 0.0 4.0 0.4 friction Other properties 50 11. ing = 0.53125 f 0.0 1.0 0.25 ingestion Other properties 51 12. as = 0.15625 f 0.0 1.0 0.25 assimilation Other properties 52 52 13. rx = 0.0 f rot.x Geometry 53 53 14. ry = 0.0 f rot.y Geometry … … 69 69 0. h = 0.0 f 0 1 0 hollow Extra properties 70 70 1. dn = 1.0 f 0.2 5.0 1.0 density Extra properties 71 2. fr = 0.976f 0.0 4.0 0.4 friction Extra properties72 3. ing = 0. 475f 0.0 1.0 0.25 ingestion Extra properties73 4. as = 0.1 75f 0.0 1.0 0.25 assimilation Extra properties71 2. fr = 1.12 f 0.0 4.0 0.4 friction Extra properties 72 3. ing = 0.53125 f 0.0 1.0 0.25 ingestion Extra properties 73 4. as = 0.15625 f 0.0 1.0 0.25 assimilation Extra properties 74 74 5. vs = 0.2 f 0.05 0.7 0.2 visual thickness Extra properties 75 75 6. vr = 0.5 f 0.0 1.0 1.0 red component Extra 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'89 90 Let's see f0... (check out part # 2!)91 92 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 93 p:1.0, fr=1.12, ing=0.53125, as=0.15625, v r=0.5, 0.5, 0.594 p:2.0, h=0.548814,fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.588 The value is now '0.514873' 89 90 Let's see f0... (check out part #1 !) 91 92 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 93 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 94 p:2.0, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 95 95 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 96 96 j:1, 2, dx=1.0, 0.0, 0.0, stam=0.175, vr=0.5, 0.5, 0.5 … … 104 104 ## ## 105 105 ############################################# 106 (joint # 0)106 (joint # 1) 107 107 Similarly as with Part, the full list of properties comes first: 108 108 109 109 # id type name group (27 properties) 110 0. p1 = 0d -1 999999 -1 part1 ref# Connections111 1. p2 = 1d -1 999999 -1 part2 ref# Connections110 0. p1 = 1 d -1 999999 -1 part1 ref# Connections 111 1. p2 = 2 d -1 999999 -1 part2 ref# Connections 112 112 2. rx = 0.0 f rotation.x Geometry 113 113 3. ry = 0.0 f rotation.y Geometry … … 129 129 19. stif = 1.0 f 0.0 1.0 1.0 stiffness Other properties 130 130 20. rotstif = 1.0 f 0.0 1.0 1.0 rotation stiffness Other properties 131 21. stam = 0.1 5625f 0.0 1.0 0.25 stamina Other properties131 21. stam = 0.175 f 0.0 1.0 0.25 stamina Other properties 132 132 22. i = s info Other properties 133 133 23. Vstyle = joint s 0 0 joint vis_style Visual … … 141 141 Delta fields (dx,dy,dz) describe relative location of the second part. 142 142 This joint will change the second Part's positions to preserve delta distance. 143 Let's move the first Part (# 0) along y axis (+0.1) and change delta.z (dz) by 0.1.144 Position of the second Part referenced by this joint (part # 1) is now changed:145 146 p: y=0.1,fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5147 p:1.0, 0.1, 0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5148 p:2.0, 0.1, 0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5149 j:0, 1, dx=1.0, 0.0, 0. 1, stam=0.15625, vr=0.5, 0.5, 0.5150 j:1, 2, dx=1.0, 0.0, 0. 0, stam=0.175, vr=0.5, 0.5, 0.5143 Let's move the first Part (#1) along y axis (+0.1) and change delta.z (dz) by 0.1. 144 Position of the second Part referenced by this joint (part #2) is now changed: 145 146 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 147 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 148 p:2.0, z=0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 149 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 150 j:1, 2, dx=1.0, 0.0, 0.1, stam=0.175, vr=0.5, 0.5, 0.5 151 151 n:j=0, d=@:p=0.6543 152 152 n:j=1, d=G … … 158 158 As you can see, Joint's delta fields have altered: 159 159 160 p: y=0.1,fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5161 p:1.0, 0.1, -0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5162 p:2.0, 0.1, -0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5163 j:0, 1, dx=1.0, 0.0, -0.1, stam=0.15625, vr=0.5, 0.5, 0.5164 j:1, 2, dx=1.0, 0.0, 0.0, stam=0.175, vr=0.5, 0.5, 0.5160 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 161 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 162 p:2.0, z=-0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 163 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 164 j:1, 2, dx=1.0, 0.0, -0.1, stam=0.175, vr=0.5, 0.5, 0.5 165 165 n:j=0, d=@:p=0.6543 166 166 n:j=1, d=G … … 171 171 f0 is now: 172 172 173 p: y=0.1,fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5174 p:1.0, 0.1, -0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5175 p:2.0, 0.1, -0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5176 j:0, 1, stam=0.15625, vr=0.5, 0.5, 0.5177 j:1, 2, dx=1.0, 0.0, 0.0,stam=0.175, vr=0.5, 0.5, 0.5173 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 174 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 175 p:2.0, z=-0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 176 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 177 j:1, 2, stam=0.175, vr=0.5, 0.5, 0.5 178 178 n:j=0, d=@:p=0.6543 179 179 n:j=1, d=G … … 188 188 189 189 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 190 p:1.0, 0.1, -0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5191 p:2.0, 0.1, -0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5192 j:0, 1, stam=0.15625, vr=0.5, 0.5, 0.5193 j:1, 2, dx=1.0, 0.0, 0.0,stam=0.175, vr=0.5, 0.5, 0.5190 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 191 p:2.0, z=-0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 192 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 193 j:1, 2, stam=0.175, vr=0.5, 0.5, 0.5 194 194 n:j=0, d=@:p=0.6543 195 195 n:j=1, d=G … … 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:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 217 p:1.0, 0.1, -0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5218 p:2.0, 0.1, -0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5219 j:0, 1, stam=0.15625, vr=0.5, 0.5, 0.592845220 j:1, 2, dx=1.0, 0.0, 0.0, stam=0.175, vr=0.5, 0.5, 0.5217 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 218 p:2.0, z=-0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 219 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 220 j:1, 2, stam=0.175, vr=0.5, 0.857946, 0.5 221 221 n:j=0, d=@:p=0.6543 222 222 n:j=1, d=G … … 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: … … 234 234 # id type name group (10 properties) 235 235 0. p = -1 d -1 999999 -1 part ref# Connections 236 1. j = 0d -1 999999 -1 joint ref# Connections237 2. d = @:p=0.6543s details Other236 1. j = 1 d -1 999999 -1 joint ref# Connections 237 2. d = G s details Other 238 238 3. i = s info Other 239 239 4. Vstyle = neuro s 0 0 neuro vis_style Visual 240 5. getInputCount = 1d input count Connections240 5. getInputCount = 0 d input count Connections 241 241 9. classObject = null oNeuroClass neuron class Connections 242 242 … … 248 248 Each neuron can have any number of inputs = weighted connections 249 249 with other neurons. 250 According to Neuro::getInputCount(), this one has 1inputs.250 According to Neuro::getInputCount(), this one has 0 inputs. 251 251 Standard API is provided for accessing those inputs (getInput(int)), 252 252 adding inputs (addInput(Neuro*)) and removing them (removeInput(int)). … … 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 ' @:p=0.6543'.258 ' @' is the class name (Neuro::getClassName() == '@') and means 'Rotation muscle'.257 Currently the value of 'd' is 'G'. 258 'G' is the class name (Neuro::getClassName() == 'G') and means 'Gyroscope'. 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 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. 264 The class defines its own properties: 265 266 [ data provided by Neuro::classProperties() ] 267 # id type name group (1 properties) 268 0. p = 0.6543 f 0.01 1.0 1.0 power Rotation muscle 269 and they can be changed: 270 Change property #0 to random value from range [0.01..1] 271 Current value of 'p' (power) is '0.6543' 272 Setting new value... [ using ParamInterface::set() ] 273 The value is now '0.718037' 274 After that, 'details' contains the new object: '@:p=0.718037'. 261 For the current object we can learn that it supports no inputs (getPreferredInputs()) and provides meaningful output signal (getPreferredOutput()==1). 262 Instances of 'G' can be used in models having shape types: 'ball-and-stick'. 263 Instances of 'G' can be attached to Joints having any shapes. 264 (This class does not have its own properties 265 - Neuro::classProperties().getPropCount()==0) 275 266 The class of this object can be changed using Neuro::setClassName() 276 267 The following classes are available: … … 302 293 22. Sin Sinus generator 2 303 294 304 Let's change the Neuro's class to 'Water'... 305 [WARN] Param.loadSingleLine: Unknown property 'Water.p' (ignored) 306 Info for input #0 = "" 307 Info for input #0, field "abc" = "" 308 The final object description will be then: 'Water' 295 Let's change the Neuro's class to 'ChMux'... 296 The final object description will be then: 'ChMux' 309 297 And the full f0 genotype: 310 298 311 299 p:fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5 312 p:1.0, 0.1, -0.1, fr=1.12, ing=0.53125, as=0.15625, vr=0.5, 0.5, 0.5313 p:2.0, 0.1, -0.1, h=0.548814, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5314 j:0, 1, stam=0.15625, vr=0.5, 0.5, 0.592845315 j:1, 2, dx=1.0, 0.0, 0.0, stam=0.175, vr=0.5, 0.5, 0.5316 n:j=0, d= Water317 n:j=1, d= G318 c:0, 1, -1.23456 , i="test=44,abc=yeah"300 p:1.0, fr=1.12, ing=0.53125, as=0.15625, vs=0.514873, vr=0.5, 0.5, 0.5 301 p:2.0, z=-0.1, fr=0.976, ing=0.475, as=0.175, vr=0.5, 0.5, 0.5 302 j:0, 1, dx=1.0, 0.0, 0.0, stam=0.15625, vr=0.5, 0.5, 0.5 303 j:1, 2, stam=0.175, vr=0.5, 0.857946, 0.5 304 n:j=0, d=@:p=0.6543 305 n:j=1, d=ChMux 306 c:0, 1, -1.23456 319 307 320 308 … … 324 312 1. You can redirect output: genomanipulation >filename.txt 325 313 2. Each run can yield different results and new behaviors, but you 326 need to uncomment srand(time(0)) in genomanipulation.cpp.314 need to uncomment rndRandomizeSeed() in genomanipulation.cpp. 327 315 3. This application will use custom genotype passed as 328 316 a commandline parameter: genomanipulation "/*9*/FULU"
Note: See TracChangeset
for help on using the changeset viewer.