- Timestamp:
- 07/20/20 16:54:30 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/genomanipulation.cpp
r1009 r1018 41 41 { 42 42 if (pi.getPropCount() <= 0) return; 43 int i = r and() % pi.getPropCount();43 int i = rndUint(pi.getPropCount()); 44 44 double maxprop = 1, minprop = 0, def; 45 45 pi.getMinMaxDouble(i, minprop, maxprop, def); … … 251 251 printf("%2d.%6s %-20s %2d\n", i, cl->getName().c_str(), cl->getLongName().c_str(), p.getPropCount()); 252 252 } 253 int cl = r and() % n->getClassCount();253 int cl = rndUint(n->getClassCount()); 254 254 printf("\nLet's change the Neuro's class to '%s'...\n", n->getClassName(cl).c_str()); 255 255 n->getModel().open(); … … 294 294 PreconfiguredGenetics genetics; 295 295 296 // srand(time(0)); //uncomment to see the demonstration of different behaviors and results on each run296 //rndRandomizeSeed(); //uncomment to see the demonstration of different behaviors and results on each run 297 297 printNiceBanner("Welcome to Genotype Manipulation Demo!"); 298 298 … … 328 328 if (m.getPartCount() > 0) 329 329 { 330 int p = r and() % m.getPartCount();330 int p = rndUint(m.getPartCount()); 331 331 printNiceBanner("P A R T O B J E C T"); 332 332 printf(" (part # %d)\n", p); … … 336 336 if (m.getJointCount() > 0) 337 337 { 338 int j = r and() % m.getJointCount();338 int j = rndUint(m.getJointCount()); 339 339 printNiceBanner("J O I N T O B J E C T"); 340 340 printf(" (joint # %d)\n", j); … … 344 344 if (m.getNeuroCount() > 0) 345 345 { 346 int n = r and() % m.getNeuroCount();346 int n = rndUint(m.getNeuroCount()); 347 347 printNiceBanner("N E U R O O B J E C T"); 348 348 printf(" (neuro # %d)\n", n); … … 376 376 " 1. You can redirect output: genomanipulation >filename.txt\n" 377 377 " 2. Each run can yield different results and new behaviors, but you\n" 378 " need to uncomment srand(time(0)) in genomanipulation.cpp.\n"378 " need to uncomment rndRandomizeSeed() in genomanipulation.cpp.\n" 379 379 " 3. This application will use custom genotype passed as\n" 380 380 " a commandline parameter: genomanipulation \"/*9*/FULU\"\n"
Note: See TracChangeset
for help on using the changeset viewer.