Changeset 139 for cpp/frams/genetics


Ignore:
Timestamp:
02/20/14 17:49:28 (6 years ago)
Author:
sz
Message:

class renaming + minor corrections

Location:
cpp/frams/genetics
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/defgenoconv.cpp

    r121 r139  
    77#include GEN_CONFIG_FILE
    88
    9 #ifdef USE_GENCONV_F10
     9#ifdef USE_GENCONV_f10
    1010#include "f1/conv_f1.h"
    1111#endif
    12 #ifdef USE_GENCONV_F20
     12#ifdef USE_GENCONV_f20
    1313#include "f2/conv_f2.h"
    1414#endif
    15 #ifdef USE_GENCONV_F32
     15#ifdef USE_GENCONV_f32
    1616#include "f3/conv_f3.h"
    1717#endif
    18 #ifdef USE_GENCONV_F40
     18#ifdef USE_GENCONV_f40
    1919#include "f4/conv_f4.h"
    2020#endif
    21 #ifdef USE_GENCONV_F41_TEST
     21#ifdef USE_GENCONV_f41_TEST
    2222#include "f4/conv_f4.h"
    2323#endif
    24 #ifdef USE_GENCONV_F50
     24#ifdef USE_GENCONV_f50
    2525#include "f5/conv_f5.h"
    2626#endif
    27 #ifdef USE_GENCONV_F60
     27#ifdef USE_GENCONV_f60
    2828#include "f6/geno_f6.h"
    2929#endif
    30 #ifdef USE_GENCONV_F70
     30#ifdef USE_GENCONV_f70
    3131#include "f7/conv_f7.h"
    3232#endif
    33 #ifdef USE_GENCONV_F81
     33#ifdef USE_GENCONV_f81
    3434#include "f8/conv_f8tof1.h"
    3535#endif
    36 #ifdef USE_GENCONV_F90
     36#ifdef USE_GENCONV_f90
    3737#include "f9/conv_f9.h"
     38#endif
     39#ifdef USE_GENCONV_fF0
     40#include "fF/conv_fF.h"
    3841#endif
    3942
    4043DefaultGenoConvManager::DefaultGenoConvManager()
    4144{
    42 #ifdef USE_GENCONV_F10
    43 addConverter(new GenoConv_F1());
     45#ifdef USE_GENCONV_f10
     46        addConverter(new GenoConv_f1());
    4447#endif
    45 #ifdef USE_GENCONV_F20
    46 addConverter(new GenoConv_F20());
     48#ifdef USE_GENCONV_f20
     49        addConverter(new GenoConv_f20());
    4750#endif
    48 #ifdef USE_GENCONV_F32
    49 addConverter(new GenoConv_F32());
     51#ifdef USE_GENCONV_f32
     52        addConverter(new GenoConv_f32());
    5053#endif
    51 #ifdef USE_GENCONV_F40
    52 addConverter(new GenoConv_F40());
     54#ifdef USE_GENCONV_f40
     55        addConverter(new GenoConv_f40());
    5356#endif
    54 #ifdef USE_GENCONV_F41_TEST
    55 addConverter(new GenoConv_F41_TestOnly());
     57#ifdef USE_GENCONV_f41_TEST
     58        addConverter(new GenoConv_f41_TestOnly());
    5659#endif
    57 #ifdef USE_GENCONV_F50
    58 addConverter(new GenoConv_F50);
     60#ifdef USE_GENCONV_f50
     61        addConverter(new GenoConv_f50);
    5962#endif
    60 #ifdef USE_GENCONV_F60
    61 addConverter(new GenoConv_F60);
     63#ifdef USE_GENCONV_f60
     64        addConverter(new GenoConv_f60);
    6265#endif
    63 #ifdef USE_GENCONV_F70
    64 addConverter(new GenoConv_F70);
     66#ifdef USE_GENCONV_f70
     67        addConverter(new GenoConv_f70);
    6568#endif
    66 #ifdef USE_GENCONV_F81
    67 addConverter(new GenoConv_F8ToF1());
     69#ifdef USE_GENCONV_f81
     70        addConverter(new GenoConv_f8ToF1());
    6871#endif
    69 #ifdef USE_GENCONV_F90
    70 addConverter(new GenoConv_F90);
     72#ifdef USE_GENCONV_f90
     73        addConverter(new GenoConv_f90);
     74#endif
     75#ifdef USE_GENCONV_fF0
     76        addConverter(new GenoConv_fF0);
    7177#endif
    7278
    73 param.updatetab();
     79        param.updatetab();
    7480}
  • cpp/frams/genetics/f1/conv_f1.cpp

    r121 r139  
    100100
    101101/** main conversion function - with conversion map support */
    102 SString GenoConv_F1::convert(SString &i,MultiMap *map)
     102SString GenoConv_f1::convert(SString &i,MultiMap *map)
    103103{
    104104const char* g=(const char*)i;
  • cpp/frams/genetics/f1/conv_f1.h

    r121 r139  
    6060 
    6161*/
    62 class GenoConv_F1: public GenoConverter
     62class GenoConv_f1: public GenoConverter
    6363{
    6464public:
    65 GenoConv_F1()
     65GenoConv_f1()
    6666        {
    6767        name="Recursive encoding";
     
    7070        }
    7171SString convert(SString &i,MultiMap *map);
    72 ~GenoConv_F1() {}
     72~GenoConv_f1() {}
    7373};
    7474
  • cpp/frams/genetics/f9/conv_f9.cpp

    r125 r139  
    1010#define APPLY_DETERMINISTIC_BODY_NOISE //this representation easily produces perfectly vertical sticks that would stay upright forever. In most cases such infinite perfection is not desired, so we make the construct less perfect by perturbing its coordinates.
    1111
    12 GenoConv_F90::GenoConv_F90()
     12GenoConv_f90::GenoConv_f90()
    1313{
    1414        name = "Turtle3D-ortho encoding";
     
    2525//const char* turtle_commandsZ_f9="0000-+";
    2626
    27 SString GenoConv_F90::convert(SString &in, MultiMap *map)
     27SString GenoConv_f90::convert(SString &in, MultiMap *map)
    2828{
    2929        vector<XYZ_LOC> vertices;
     
    5555}
    5656
    57 int GenoConv_F90::addSegment(Model &m,vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex,int recently_added)
     57int GenoConv_f90::addSegment(Model &m,vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex,int recently_added)
    5858{
    5959        if (vertices.size()<1)
     
    7777}
    7878
    79 int GenoConv_F90::findVertexAt(vector<XYZ_LOC> &vertices,const XYZ_LOC &vertex)
     79int GenoConv_f90::findVertexAt(vector<XYZ_LOC> &vertices,const XYZ_LOC &vertex)
    8080{
    8181        for(int i=0;i<vertices.size();i++)
     
    8585
    8686
    87 int GenoConv_F90::addNewVertex(Model &m,vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex)
     87int GenoConv_f90::addNewVertex(Model &m,vector<XYZ_LOC> &vertices,const XYZ_LOC &new_vertex)
    8888{
    8989        Part *p=new Part;
     
    110110}
    111111
    112 void GenoConv_F90::setColors(Model &m) //sets fixed (independent from genes) colors and widths on a model, purely for aesthetic purposes
     112void GenoConv_f90::setColors(Model &m) //sets fixed (independent from genes) colors and widths on a model, purely for aesthetic purposes
    113113{
    114114        //a rainbow on Joints: from the first one red, through middle green, to blue or violet - last
     
    145145}
    146146
    147 void GenoConv_F90::perturbPartLocations(Model &m) //deterministic "body noise", see APPLY_DETERMINISTIC_BODY_NOISE
     147void GenoConv_f90::perturbPartLocations(Model &m) //deterministic "body noise", see APPLY_DETERMINISTIC_BODY_NOISE
    148148{
    149149        for(int i=0;i<m.getPartCount();i++)
  • cpp/frams/genetics/f9/conv_f9.h

    r125 r139  
    2929
    3030// The f9->f0 converter
    31 class GenoConv_F90: public GenoConverter
     31class GenoConv_f90: public GenoConverter
    3232{
    3333public:
    34         GenoConv_F90();
     34        GenoConv_f90();
    3535
    36         //implementation GenoConverter method
     36        //implementation of the GenoConverter method
    3737        SString convert(SString &in, MultiMap *map);
    3838
  • cpp/frams/genetics/f9/oper_f9.h

    r120 r139  
    1818        int crossOver(char *&g1,char *&g2,float& chg1,float& chg2);
    1919        unsigned long style(const char *g, int pos);
    20         char* getSimplest() {return "R";}
     20        const char* getSimplest() {return "R";}
    2121
    2222        double mut_prob; //mutation probability
  • cpp/frams/genetics/gen-config-GDK.h

    r138 r139  
    1212 */
    1313
    14 #define USE_GENCONV_F10
    15 //#define USE_GENCONV_F21
    16 //#define USE_GENCONV_F30
    17 //#define USE_GENCONV_F40
    18 //#define USE_GENCONV_F41_TEST
    19 //#define USE_GENCONV_F50
    20 #define USE_GENCONV_F90
     14#define USE_GENCONV_f10
     15//#define USE_GENCONV_f21
     16//#define USE_GENCONV_f30
     17//#define USE_GENCONV_f40
     18//#define USE_GENCONV_f41_TEST
     19//#define USE_GENCONV_f50
     20#define USE_GENCONV_f90
    2121
    22 //#define USE_GENMAN_F0
    23 //#define USE_GENMAN_F1
    24 //#define USE_GENMAN_F2
    25 //#define USE_GENMAN_F3
    26 //#define USE_GENMAN_F4
    27 //#define USE_GENMAN_F5
    28 #define USE_GENMAN_F9
     22//#define USE_GENMAN_f0
     23//#define USE_GENMAN_f1
     24//#define USE_GENMAN_f2
     25//#define USE_GENMAN_f3
     26//#define USE_GENMAN_f4
     27//#define USE_GENMAN_f5
     28#define USE_GENMAN_f9
  • cpp/frams/genetics/genman.cpp

    r138 r139  
    1111
    1212
    13 #ifdef USE_GENMAN_F0
     13#ifdef USE_GENMAN_f0
    1414#include "f0/oper_f0.h"
    1515#endif
    16 #ifdef USE_GENMAN_F0FUZZY
     16#ifdef USE_GENMAN_f0FUZZY
    1717#include "f0/oper_f0Fuzzy.h"
    1818#endif
    19 #ifdef USE_GENMAN_F1
     19#ifdef USE_GENMAN_f1
    2020#include "f1/oper_f1.h"
    2121#endif
    22 #ifdef USE_GENMAN_F2
     22#ifdef USE_GENMAN_f2
    2323#include "f2/oper_f2.h"
    2424#endif
    25 #ifdef USE_GENMAN_F2
     25#ifdef USE_GENMAN_f2
    2626#include "f3/oper_f3.h"
    2727#endif
    28 #ifdef USE_GENMAN_F4
     28#ifdef USE_GENMAN_f4
    2929#include "f4/oper_f4.h"
    3030#endif
    31 #ifdef USE_GENMAN_F5
     31#ifdef USE_GENMAN_f5
    3232#include "f5/oper_f5.h"
    3333#endif
    34 #ifdef USE_GENMAN_F6
     34#ifdef USE_GENMAN_f6
    3535#include "f6/oper_f6.h"
    3636#endif
    37 #ifdef USE_GENMAN_F7
     37#ifdef USE_GENMAN_f7
    3838#include "f7/oper_f7.h"
    3939#endif
    40 #ifdef USE_GENMAN_F8
     40#ifdef USE_GENMAN_f8
    4141#include "f8/oper_f8.h"
    4242#endif
    43 #ifdef USE_GENMAN_F9
     43#ifdef USE_GENMAN_f9
    4444#include "f9/oper_f9.h"
     45#endif
     46#ifdef USE_GENMAN_fF
     47#include "fF/oper_fF.h"
    4548#endif
    4649
     
    101104        clearStats();
    102105
    103 #ifdef USE_GENMAN_F0
     106#ifdef USE_GENMAN_f0
    104107        geno_fx_list.push_back(new Geno_f0);
    105108#endif
    106 #ifdef USE_GENMAN_F0FUZZY
     109#ifdef USE_GENMAN_f0FUZZY
    107110        geno_fx_list.push_back(new Geno_f0Fuzzy);
    108111#endif
    109 #ifdef USE_GENMAN_F1
     112#ifdef USE_GENMAN_f1
    110113        geno_fx_list.push_back(new Geno_f1);
    111114#endif
    112 #ifdef USE_GENMAN_F2
     115#ifdef USE_GENMAN_f2
    113116        geno_fx_list.push_back(new Geno_f2);
    114117#endif
    115 #ifdef USE_GENMAN_F3
     118#ifdef USE_GENMAN_f3
    116119        geno_fx_list.push_back(new Geno_f3);
    117120#endif
    118 #ifdef USE_GENMAN_F4
     121#ifdef USE_GENMAN_f4
    119122        geno_fx_list.push_back(new Geno_f4);
    120123#endif
    121 #ifdef USE_GENMAN_F5
     124#ifdef USE_GENMAN_f5
    122125        geno_fx_list.push_back(new Geno_f5);
    123126#endif
    124 #ifdef USE_GENMAN_F6
     127#ifdef USE_GENMAN_f6
    125128        geno_fx_list.push_back(new Geno_f6);
    126129#endif
    127 #ifdef USE_GENMAN_F7
     130#ifdef USE_GENMAN_f7
    128131        geno_fx_list.push_back(new Geno_f7);
    129132#endif
    130 #ifdef USE_GENMAN_F8
     133#ifdef USE_GENMAN_f8
    131134        geno_fx_list.push_back(new Geno_f8);
    132135#endif
    133 #ifdef USE_GENMAN_F9
     136#ifdef USE_GENMAN_f9
    134137        geno_fx_list.push_back(new GenoOper_f9);
     138#endif
     139#ifdef USE_GENMAN_fF
     140        geno_fx_list.push_back(new GenoOper_fF);
    135141#endif
    136142
  • cpp/frams/genetics/oper_fx.h

    r121 r139  
    160160
    161161/**\return a pointer to the simplest genotype string*/
    162    virtual char* getSimplest() {return NULL;}
     162   virtual const char* getSimplest() {return NULL;}
    163163
    164164/**You may want to have your genotype colored. This method provides desired character styles for genes.
Note: See TracChangeset for help on using the changeset viewer.