src/FitnessFunctions.cpp
EchoBay::Comparator::Comparator(const std::string &problemType, const std::string &fitnessRule)
{
    // Assign internal variables
    _problemType = problemType;
    _fitnessRule = fitnessRule;
    try
    {
        switch(problemTypes.at(problemType))
        {
            // Regression
            case 0:
                if (fitnessRule == "MSA")
                {
                    fitnessFunction = MSA;
                }
                else
                {
                    fitnessFunction = NRMSE;
                }
                break;
            // Classification
            case 1:
                if (fitnessRule == "F1Mean")
                {
                    fitnessFunction = F1Mean;
                }
                else
                {
                    fitnessFunction = Accuracy;
                }
                break;
            // Memory capacity
            case 3:
                fitnessFunction = MemoryCapacity;
                break;
            // External function
#ifdef USE_PYBIND
            case 4:
                fitnessFunction = ExtFitness;
                break;
#endif
        }
    } 
    catch (const std::exception &e)
    {
        std::cout << "Undefined problemType" << std::endl;
    }
}
/**
 * @brief Construct a Comparator class for a given problem with a specific fitness function
 * 
 * @param problemType Classification, Regression or MemoryCapacity
 * @param fitnessRule fitness function dependent from the chosen problemType
 */
@brief Construct a Comparator class for a given problem with a specific fitness function

@param problemType Classification, Regression or MemoryCapacity
@param fitnessRule fitness function dependent from the chosen problemType
@brief Construct a Comparator class for a given problem with a specific fitness function @param problemType Classification Regression or MemoryCapacity @param fitnessRule fitness function dependent from the chosen problemType
EchoBay::Comparator::Comparator(const std::string &problemType, const std::string &fitnessRule)
{
    _problemType = problemType;
    _fitnessRule = fitnessRule;
    try
    {
        switch(problemTypes.at(problemType))
        {
            case 0:
                if (fitnessRule == "MSA")
                {
                    fitnessFunction = MSA;
                }
                else
                {
                    fitnessFunction = NRMSE;
                }
                break;
            case 1:
                if (fitnessRule == "F1Mean")
                {
                    fitnessFunction = F1Mean;
                }
                else
                {
                    fitnessFunction = Accuracy;
                }
                break;
            case 3:
                fitnessFunction = MemoryCapacity;
                break;
#ifdef USE_PYBIND
            case 4:
                fitnessFunction = ExtFitness;
                break;
#endif
        }
    } 
    catch (const std::exception &e)
    {
        std::cout << "Undefined problemType" << std::endl;
    }
}
EchoBay :: Comparator :: Comparator ( const std :: string & problemType , const std :: string & fitnessRule ) { _problemType = problemType ; _fitnessRule = fitnessRule ; try { switch ( problemTypes . at ( problemType ) ) { case 0 : if ( fitnessRule == " " ) { fitnessFunction = MSA ; } else { fitnessFunction = NRMSE ; } break ; case 1 : if ( fitnessRule == " " ) { fitnessFunction = F1Mean ; } else { fitnessFunction = Accuracy ; } break ; case 3 : fitnessFunction = MemoryCapacity ; break ; #ifdef USE_PYBIND case 4 : fitnessFunction = ExtFitness ; break ; #endif } } catch ( const std :: exception & e ) { std :: cout << " " << std :: endl ; } }
@brief Construct a Comparator class for a given problem with a specific fitness function
@brief Construct a Comparator class for a given problem with a specific fitness function
// Assign internal variables // Regression // Classification // Memory capacity // External function