Changeset 1009
- Timestamp:
- 07/15/20 00:19:52 (4 years ago)
- Location:
- cpp
- Files:
-
- 33 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/evol_test.cpp
r1008 r1009 127 127 //TODO add b - bounding box volume (from Model), s - surface area (from geometry), v - volume (from geometry), h,w,d - three consecutive dimensions (from geometry) 128 128 129 printf("\nThe output con tains7 columns separated by the TAB character.\n");129 printf("\nThe output consists of 7 columns separated by the TAB character.\n"); 130 130 printf("The first column is the number of mutated or crossed over and evaluated genotypes.\n"); 131 131 printf("The remaining columns are triplets of min,avg,max (in the population) of fitness, Parts, Joints, Neurons, Connections, genotype characters.\n"); … … 192 192 if (i % population.size() == 0 || i == nr_evals - 1) 193 193 { 194 printf("Evaluation %d \t", i);194 printf("Evaluation %d", i); 195 195 for (char c : string("!PJNCL")) 196 196 { 197 printf("\t"); 197 198 print_stats(population, c); 198 printf("\t");199 199 } 200 200 printf("\n"); … … 204 204 { 205 205 printf("%.1f\t", ind.fitness); 206 printf("%s\n", ind.geno.getGenes ().c_str());206 printf("%s\n", ind.geno.getGenesAndFormat().c_str()); 207 207 } 208 208 -
cpp/frams/_demos/full_props.cpp
r999 r1009 63 63 { 64 64 case 'r': reverse = true; break; 65 case 'h': puts(" usage: full_props [-r[everse]] [genotype_or_stdin]\n"); break;65 case 'h': puts("Usage: full_props [-r[everse]] [genotype_or_stdin]\n"); break; 66 66 } 67 67 else … … 79 79 if (!m.isValid()) 80 80 { 81 logPrintf(" ", "full_props", LOG_ERROR, "Cannot build Model from the supplied genotype\n");81 logPrintf("full_props", "main", LOG_ERROR, "Cannot build Model from the supplied genotype.\n"); 82 82 return 2; 83 83 } … … 88 88 Neuro *n = m.getNeuro(i); 89 89 SyntParam p = n->classProperties(reverse); 90 p.update();// ...so everyone reading the source can recognize that p was created to update the neuro d field 91 // but actually, calling update() here is not necessary, because ~SyntParam() would do it anyway90 p.update();// ...so everyone reading the source can recognize that p was created to update the neuro d field; 91 // but actually, calling update() here is not necessary, because the ~SyntParam() destructor would do it anyway. 92 92 } 93 93 m.close(); 94 94 95 // normal f0 (omitting default values) would be retrieved using m.getF0Geno()96 // the following form allows for more control:95 // Normal f0 (omitting default values) would be retrieved using m.getF0Geno(). 96 // The following form allows for more control: 97 97 Geno f0_g; 98 m.makeGeno(f0_g, NULL, reverse);// third argis "handle_defaults" == whether f0 should omit default property values98 m.makeGeno(f0_g, NULL, reverse);//The third argument is "handle_defaults" == whether f0 should omit default property values 99 99 puts(f0_g.getGenesAndFormat().c_str()); 100 100 101 101 return 0; 102 102 } 103 -
cpp/frams/_demos/genomanipulation.cpp
r999 r1009 378 378 " need to uncomment srand(time(0)) in genomanipulation.cpp.\n" 379 379 " 3. This application will use custom genotype passed as\n" 380 " a commandline parameter: genomanipulation XX\n"380 " a commandline parameter: genomanipulation \"/*9*/FULU\"\n" 381 381 "\n"); 382 382 return 0; -
cpp/tests/SDK-tests.txt
r798 r1009 1 exe:geno_test 1 exe:geno_test.exe 2 2 3 3 TESTNAME:geno_test valid f1 … … 36 36 RUNTEST 37 37 38 ################################## 38 ################################## another executable... ################################## 39 39 40 40 exe:full_props … … 44 44 out:*INSERTPLATFORMDEPENDENTFILE*:full_props_x 45 45 RUNTEST 46 47 TESTNAME:full_props with a more complex genotype 48 arg:FIX[@,p:0.6543,1:-1.23456]X[G] 49 out:*INSERTPLATFORMDEPENDENTFILE*:full_props-complex 50 RUNTEST 51 52 TESTNAME:full_props with fS 53 arg:/*S*/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} 54 out:*INSERTPLATFORMDEPENDENTFILE*:full_props-fS 55 RUNTEST 56 57 ################################## another executable... ################################## 58 59 exe:f0_variants_test 60 61 TESTNAME:f0_variants_test 62 out:*INSERTPLATFORMDEPENDENTFILE*:f0_variants_test-default 63 RUNTEST 64 65 TESTNAME:f0_variants_test with a more complex genotype 66 arg:FIX[@,p:0.6543,1:-1.23456]X[G] 67 out:*INSERTPLATFORMDEPENDENTFILE*:f0_variants_test-complex 68 RUNTEST 69 70 TESTNAME:f0_variants_test with fS 71 arg:/*S*/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} 72 out:*INSERTPLATFORMDEPENDENTFILE*:f0_variants_test-fS 73 RUNTEST 74 75 ################################## another executable... ################################## 76 77 exe:genoconv_test 78 79 TESTNAME:genoconv_test 80 out:*INSERTPLATFORMDEPENDENTFILE*:genoconv_test-default 81 RUNTEST 82 83 TESTNAME:genoconv_test with a more complex genotype 84 arg:FIX[@,p:0.6543,1:-1.23456]X[G] 85 out:*INSERTPLATFORMDEPENDENTFILE*:genoconv_test-complex 86 RUNTEST 87 88 TESTNAME:genoconv_test with a simple multiplying converter 89 arg:/*multiply*/2X2r3X2(X2) 90 out:*INSERTPLATFORMDEPENDENTFILE*:genoconv_test-simplemultiply 91 RUNTEST 92 93 TESTNAME:genoconv_test with a simple solid-shape converter 94 arg:/*shapes*/ball,cube,cylinder,cube 95 out:*INSERTPLATFORMDEPENDENTFILE*:genoconv_test-simplesolids 96 RUNTEST 97 98 ################################## another executable... ################################## 99 100 exe:genomanipulation 101 102 TESTNAME:genomanipulation 103 out:*INSERTPLATFORMDEPENDENTFILE*:genomanipulation-default 104 RUNTEST 105 106 TESTNAME:genomanipulation with a more complex genotype 107 arg:FIX[@,p:0.6543,1:-1.23456]X[G] 108 out:*INSERTPLATFORMDEPENDENTFILE*:genomanipulation-complex 109 RUNTEST 110 111 TESTNAME:genomanipulation with fS 112 arg:/*S*/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} 113 out:*INSERTPLATFORMDEPENDENTFILE*:genomanipulation-fS 114 RUNTEST 115 116 ################################## another executable... ################################## 117 118 exe:genooper_test 119 120 TESTNAME:genooper_test 121 out:*INSERTPLATFORMDEPENDENTFILE*:genooper_test-default 122 #RUNTEST #fS unstable and crashes all the time, so commented out 123 #make deterministic? 124 125 TESTNAME:genooper_test with a more complex genotype 126 arg:/*4*/<<N:ML<rCXm>N:T>N:T><N:T><X>N:@[G:2.427] 127 out:*INSERTPLATFORMDEPENDENTFILE*:genooper_test-complex 128 #RUNTEST 129 130 ################################## another executable... ################################## 131 132 TESTNAME:genooper_test_fTest 133 exe:genooper_test_fTest 134 out:*INSERTPLATFORMDEPENDENTFILE*:genooper_test_fTest 135 RUNTEST 136 137 ################################## another executable... ################################## 138 139 TESTNAME:loader_test_geno 140 exe:loader_test_geno 141 arg:similarity.gen 142 arg:Spiral plant 143 out:*INSERTPLATFORMDEPENDENTFILE*:loader_test_geno 144 RUNTEST 145 146 ################################## another executable... ################################## 147 148 TESTNAME:loader_test_param 149 exe:loader_test_param 150 arg:../frams/_demos/loader_test_param.in 151 out:*INSERTPLATFORMDEPENDENTFILE*:loader_test_param 152 RUNTEST 153 154 ################################## another executable... ################################## 155 156 exe:multiline_f0_test 157 158 TESTNAME:multiline_f0_test default 159 out:*INSERTPLATFORMDEPENDENTFILE*:multiline_f0_test-default 160 RUNTEST 161 162 TESTNAME:multiline_f0_test with complex genotype 163 arg:FIX[@,p:0.6543,1:-1.23456]X[G] 164 out:*INSERTPLATFORMDEPENDENTFILE*:multiline_f0_test-complex 165 RUNTEST 166 167 TESTNAME:multiline_f0_test with fS 168 arg:/*S*/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} 169 out:*INSERTPLATFORMDEPENDENTFILE*:multiline_f0_test-fS 170 RUNTEST 171 172 ################################## another executable... ################################## 173 174 TESTNAME:mutableparam_test 175 exe:mutableparam_test 176 out:*INSERTPLATFORMDEPENDENTFILE*:mutableparam_test 177 RUNTEST 178 179 ################################## another executable... ################################## 180 181 TESTNAME:neuro_layout_test 182 exe:neuro_layout_test 183 arg:/*4*/<lX>CfmQ<,fm<<<<rFX>N:N[-2:-0.202]>X>mfrm<<<N:M<rFX>N:N[-2:3.64]>XF>mN:*>N:T>N:T>m<m<<<N:M<r<r<<N:M<rX>N:N[-2:0.58]>X>qfrm<<<N:M<rFX>N:N[-2:3.64]>XF>mN:*>N:T>N:N[-2:-0.495]>N:N[-2:-0.495]>X>qfm<<imN:*><XF>N:M<rFX>N:N[-2:3.64]>N:T>N:T>N:T 184 out:*INSERTPLATFORMDEPENDENTFILE*:neuro_layout_test 185 RUNTEST 186 187 ################################## another executable... ################################## 188 189 TESTNAME:neuro_test 190 exe:neuro_test 191 arg:X[N][Nu][G][Gpart][T][Tcontact][Tproximity][S][*][|][@][M][D][DoesNotExist][Fuzzy][VEye][VMotor][Sti][LMu][Water][Energy][Ch][ChMux][ChSel][Rnd][Sin][Delay][Light][Nn][PIDP][PIDV][SeeLight][SeeLight2][S0][S1][Thr] 192 arg:30 193 out:*INSERTPLATFORMDEPENDENTFILE*:neuro_test 194 RUNTEST 195 196 ################################## another executable... ################################## 197 198 TESTNAME:paramtree_paramlist_test 199 exe:paramtree_paramlist_test 200 out:*INSERTPLATFORMDEPENDENTFILE*:paramtree_paramlist_test 201 RUNTEST 202 203 ################################## another executable... ################################## 204 205 TESTNAME:paramtree_stdin_test 206 exe:paramtree_stdin_test 207 in:a 208 in:a: b: d 209 in:a: z 210 in:a: b 211 in:a: b: c 212 in:a: y 213 in:A 214 out:*INSERTPLATFORMDEPENDENTFILE*:paramtree_stdin_test 215 RUNTEST 216 217 ################################## another executable... ################################## 218 219 TESTNAME:part_shapes 220 exe:part_shapes 221 out:*INSERTPLATFORMDEPENDENTFILE*:part_shapes 222 RUNTEST 223 224 ################################## another executable... ################################## 225 226 TESTNAME:saver_test_geno 227 exe:saver_test_geno 228 arg:_tmp_saver_test_output.gen 229 arg:7 230 out:*INSERTPLATFORMDEPENDENTFILE*:saver_test_geno 231 RUNTEST 232 # we could also verify the contents of the saved file, but for this we would need a way to print it (in frams we use a script function to do this) 233 234 ################################## another executable... ################################## 235 236 exe:serial_test 237 238 TESTNAME:serial_test 239 out:*INSERTPLATFORMDEPENDENTFILE*:serial_test 240 RUNTEST 241 242 # TESTNAME:serial_test custom 243 # out:*INSERTPLATFORMDEPENDENTFILE*:serial_test-custom 244 # arg:{"2":[1]} 245 # RUNTEST 246 247 # Even though the command is launched correctly from python: ['../serial_test', '{"2":[1]}'] the executable in cygwin does not get its argument: 'input string = ' with default settings and input string = {\2\:[1]} with CYGWIN=noglob. 248 # The problem is with characters like {} and "", and CYGWIN=noglob is supposed to fix this (it fixes the same problems with {}), but there are some bugs and it is not fixed. 249 250 ################################## another executable... ################################## 251 252 TESTNAME:shapeconvert 253 exe:shapeconvert 254 out:*INSERTPLATFORMDEPENDENTFILE*:shapeconvert 255 arg:FIX[@,p:0.6543,1:-1.23456](X[G],XX) 256 RUNTEST 257 258 ################################## another executable... ################################## 259 260 exe:evol_test 261 262 TESTNAME:evol_test f9 263 arg:1 264 arg:10 265 arg:100 266 arg:0.6 267 arg:0.4 268 arg:9 269 arg:PJNCL 270 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-f9 271 RUNTEST 272 273 TESTNAME:evol_test f4 274 arg:1 275 arg:10 276 arg:100 277 arg:0.6 278 arg:0.4 279 arg:4 280 arg:PJNCL 281 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-f4 282 RUNTEST 283 284 TESTNAME:evol_test fH 285 arg:1 286 arg:10 287 arg:100 288 arg:0.6 289 arg:0.4 290 arg:H 291 arg:PJNCL 292 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-fH 293 RUNTEST 294 295 TESTNAME:evol_test fB 296 arg:1 297 arg:10 298 arg:100 299 arg:0.6 300 arg:0.4 301 arg:B 302 arg:PJNCL 303 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-fB 304 RUNTEST 305 306 TESTNAME:evol_test fL 307 arg:1 308 arg:10 309 arg:100 310 arg:0.6 311 arg:0.4 312 arg:L 313 arg:PJNCL 314 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-fL 315 RUNTEST 316 317 TESTNAME:evol_test fS 318 arg:1 319 arg:10 320 arg:100 321 arg:0.6 322 arg:0.4 323 arg:S 324 arg:PJNCL 325 out:*INSERTPLATFORMDEPENDENTFILE*:evol_test-fS 326 RUNTEST
Note: See TracChangeset
for help on using the changeset viewer.