Changeset 990 for cpp/frams


Ignore:
Timestamp:
07/09/20 01:35:59 (4 years ago)
Author:
Maciej Komosinski
Message:

Made genomanipulation demo deterministic by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/genomanipulation.cpp

    r989 r990  
    199199                                printf("any shape types.\n");
    200200                        else
    201                                 {
     201                        {
    202202                                printf("shape types:");
    203                                 for(int i=Model::SHAPE_FIRST; i<= Model::SHAPE_LAST; i++)
     203                                for (int i = Model::SHAPE_FIRST; i <= Model::SHAPE_LAST; i++)
    204204                                        if (cl->isShapeTypeSupported((Model::ShapeType)i))
    205                                                 printf(" '%s'",Model::getShapeTypeName((Model::ShapeType)i));
     205                                                printf(" '%s'", Model::getShapeTypeName((Model::ShapeType)i));
    206206                                printf(".\n");
    207                                 }
     207                        }
    208208                        if (cl->preflocation == NeuroClass::PREFER_JOINT)
    209                                 {
     209                        {
    210210                                printf("Instances of '%s' can be attached to Joints having ", cl->getName().c_str());
    211211                                if (cl->getSupportedJointShapes() == NeuroClass::SUPPORTED_JOINT_ALL)
    212212                                        printf("any shapes");
    213213                                else
    214                                         {
     214                                {
    215215                                        printf("shapes:");
    216                                         for(int i=Joint::SHAPE_FIRST; i<= Joint::SHAPE_LAST; i++)
     216                                        for (int i = Joint::SHAPE_FIRST; i <= Joint::SHAPE_LAST; i++)
    217217                                                if (cl->isJointShapeSupported((Joint::Shape)i))
    218                                                         printf(" '%s'",Joint::getShapeName((Joint::Shape)i));
    219                                         }
     218                                                        printf(" '%s'", Joint::getShapeName((Joint::Shape)i));
     219                                }
    220220                                printf(".\n");
    221                                 }
     221                        }
    222222                        else if (cl->preflocation == NeuroClass::PREFER_PART)
    223223                                printf("Instances of '%s' can be attached to Parts.\n", cl->getName().c_str());
     
    283283{
    284284        GenoConverter *gc = Geno::getConverters()->findConverters(0, '1');
    285         if (gc) printf("found converter accepting f1: \"%s\"\n", gc->name);
     285        if (gc) printf("Found converter accepting f1: \"%s\"\n", gc->name);
    286286        SListTempl<GenoConverter*> found;
    287287        Geno::getConverters()->findConverters(&found, Geno::FORMAT_UNKNOWN, '0');
    288         printf("found %d converter(s) producing f0\n", found.size());
     288        printf("Found %d converter(s) producing f0\n", found.size());
    289289}
    290290
     
    294294        PreconfiguredGenetics genetics;
    295295
    296         srand(time(0));
    297         printNiceBanner("Welcome to Genotype Manipulation App!");
     296        //srand(time(0)); //uncomment to see the demonstration of different behaviors and results on each run
     297        printNiceBanner("Welcome to Genotype Manipulation Demo!");
    298298
    299299        findingConverters();
     
    375375                "Hints:\n"
    376376                "  1. You can redirect output: genomanipulation >filename.txt\n"
    377                 "  2. Each run can yield different results, because some\n"
    378                 "     values are randomly generated.\n"
     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"
    379379                "  3. This application will use custom genotype passed as\n"
    380380                "     a commandline parameter: genomanipulation XX\n"
Note: See TracChangeset for help on using the changeset viewer.