Changeset 907 for cpp


Ignore:
Timestamp:
02/04/20 19:18:52 (6 months ago)
Author:
Maciej Komosinski
Message:

Code formatting

Location:
cpp/frams/neuro/impl
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/neuro/impl/neuroimpl-body-sdk.h

    r791 r907  
    1111{
    1212public:
    13         NeuroImpl* makeNew(){ return new NI_Gyro(); } // for NeuroFactory
     13        NeuroImpl* makeNew() { return new NI_Gyro(); } // for NeuroFactory
    1414        int lateinit() { if (!neuro->joint) return 0; simorder = 0; return 1; }
    1515        void go() { setState(0); }
     
    2121public:
    2222        double range;
    23         NeuroImpl* makeNew(){ return new NI_Touch(); } // for NeuroFactory
     23        NeuroImpl* makeNew() { return new NI_Touch(); } // for NeuroFactory
    2424        int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
    2525        void go() { setState(0); }
     
    3030{
    3131public:
    32         NeuroImpl* makeNew(){ return new NI_Smell(); } // for NeuroFactory
     32        NeuroImpl* makeNew() { return new NI_Smell(); } // for NeuroFactory
    3333        void go() { setState(0); }
    3434        int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
     
    4040public:
    4141        double power, bendrange;
    42         NeuroImpl* makeNew(){ return new NI_BendMuscle(); } // for NeuroFactory
     42        NeuroImpl* makeNew() { return new NI_BendMuscle(); } // for NeuroFactory
    4343        NI_BendMuscle() { paramentries = NI_BendMuscle_tab; }
    4444        int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
     
    5151public:
    5252        double power;
    53         NeuroImpl* makeNew(){ return new NI_RotMuscle(); } // for NeuroFactory
     53        NeuroImpl* makeNew() { return new NI_RotMuscle(); } // for NeuroFactory
    5454        NI_RotMuscle() { paramentries = NI_RotMuscle_tab; }
    5555        int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
     
    6262public:
    6363        double power;
    64         NeuroImpl* makeNew(){ return new NI_RotMuscle(); } // for NeuroFactory
     64        NeuroImpl* makeNew() { return new NI_RotMuscle(); } // for NeuroFactory
    6565        NI_LinearMuscle() { paramentries = NI_RotMuscle_tab; }
    6666        int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
     
    7272public:
    7373        double power;
    74         NeuroImpl* makeNew(){ return new NI_Sticky(); } // for NeuroFactory
     74        NeuroImpl* makeNew() { return new NI_Sticky(); } // for NeuroFactory
    7575        int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
    7676        void go() {}
     
    8080{
    8181public:
    82         NeuroImpl* makeNew(){ return new NI_WaterDetect(); } // for NeuroFactory
     82        NeuroImpl* makeNew() { return new NI_WaterDetect(); } // for NeuroFactory
    8383        int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
    8484        void go() { setState(0); }
     
    8888{
    8989public:
    90         NeuroImpl* makeNew(){ return new NI_Energy(); } // for NeuroFactory
     90        NeuroImpl* makeNew() { return new NI_Energy(); } // for NeuroFactory
    9191        void go() { setState(0); }
    9292};
  • cpp/frams/neuro/impl/neuroimpl-channels.cpp

    r791 r907  
    2020        s = (max(-1.0, min(1.0, s)) + 1.0) / 2.0; // 0..1
    2121        int i1;
    22         i1 = (int)(s*(c - 1)); i1 = max(0, min(i1, c - 2));
     22        i1 = (int)(s * (c - 1)); i1 = max(0, min(i1, c - 2));
    2323        double sw = 1.0 / (c - 1);
    24         double s1 = sw*i1;
     24        double s1 = sw * i1;
    2525        double w1 = fabs((s - s1) / sw);
    2626        double w2 = 1.0 - w1;
    2727        double is1 = getWeightedInputState(1, i1);
    2828        double is2 = getWeightedInputState(1, i1 + 1);
    29         setState(is1*w2 + is2*w1);
     29        setState(is1 * w2 + is2 * w1);
    3030}
    3131
  • cpp/frams/neuro/impl/neuroimpl-channels.h

    r791 r907  
    1111{
    1212public:
    13         NeuroImpl* makeNew(){ return new NI_Channelize(); } // for NeuroFactory
     13        NeuroImpl* makeNew() { return new NI_Channelize(); } // for NeuroFactory
    1414        void go();
    1515};
     
    1818{
    1919public:
    20         NeuroImpl* makeNew(){ return new NI_ChMux(); } // for NeuroFactory
     20        NeuroImpl* makeNew() { return new NI_ChMux(); } // for NeuroFactory
    2121        void go();
    2222};
     
    2929        int ch; // channel
    3030        NI_ChSel() :ch(0) { paramentries = NI_ChSel_tab; }
    31         NeuroImpl* makeNew(){ return new NI_ChSel(); } // for NeuroFactory
     31        NeuroImpl* makeNew() { return new NI_ChSel(); } // for NeuroFactory
    3232        void go();
    3333};
     
    3535
    3636#endif
    37 
  • cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp

    r791 r907  
    105105                nrIn = rulesDef[2 * i]; // nr of inputs in rule #i
    106106                minimumCut = 2; // the highest value of membership function is 1.0, so this value will definitely change
    107                 for (j = 0; (j < nrIn) && (minimumCut>0); j++) //minimumCut can not be <0, so if =0 then stop calculations
     107                for (j = 0; (j < nrIn) && (minimumCut > 0); j++) //minimumCut can not be <0, so if =0 then stop calculations
    108108                {
    109109                        nrFuzzySet = rules[i][j * 2 + 1]; // j*2 moves pointer through each output, +1 moves to nr of fuzzy set
     
    111111                        minimumCut = min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set
    112112                }
    113                 if ((minimumCut>1) || (minimumCut < 0))
     113                if ((minimumCut > 1) || (minimumCut < 0))
    114114                        return 1;
    115115                defuzzParam[i] = minimumCut;
  • cpp/frams/neuro/impl/neuroimpl-simple.cpp

    r791 r907  
    2121{
    2222        double sum = getWeightedInputSum();
    23         velocity = force*(sum - istate) + inertia*velocity;
     23        velocity = force * (sum - istate) + inertia * velocity;
    2424        istate += velocity;
    2525        if (istate > NEURO_MAX) istate = NEURO_MAX;
  • cpp/frams/neuro/impl/neuroimpl-simple.h

    r896 r907  
    2323                paramentries = NI_StdNeuron_tab;
    2424        }
    25         NeuroImpl* makeNew(){ return new NI_StdNeuron(); } // for NeuroFactory
     25        NeuroImpl* makeNew() { return new NI_StdNeuron(); } // for NeuroFactory
    2626        int lateinit();
    2727        void go();
     
    3737                paramentries = NI_StdUNeuron_tab;
    3838        }
    39         NeuroImpl* makeNew(){ return new NI_StdUNeuron(); } // for NeuroFactory
     39        NeuroImpl* makeNew() { return new NI_StdUNeuron(); } // for NeuroFactory
    4040        void calcOutput();
    4141};
     
    4444{
    4545public:
    46         NeuroImpl* makeNew(){ return new NI_Const(); } // for NeuroFactory
     46        NeuroImpl* makeNew() { return new NI_Const(); } // for NeuroFactory
    4747        int lateinit()
    4848        {
Note: See TracChangeset for help on using the changeset viewer.