?? gafitnesscomparators.h
字號:
#ifndef __GA_FITNESS_COMPARATORS_H__
#define __GA_FITNESS_COMPARATORS_H__
#include "..\CallConvention.h"
#include "GaChromosomeOperations.h"
using namespace Chromosome;
namespace Chromosome
{
namespace FitnessComparators
{
// Used if the fitness value should be minimized
class GaMinFitnessComparator : public GaFitnessComparator
{
public:
// Compares two fitness values and returns:
// a, -1 if the first fitness value lower then the second
// b. 0 if the fitness values are equal
// c. 1 if the first fitness value is greater then the second
virtual int GACALL operator ()(float fitness1,
float fitness2) const;
};// END CLASS DEFINITION GaMinFitnessComparator
// Used if the fitness value should be maximized
class GaMaxFitnessComparator : public GaFitnessComparator
{
public:
// Compares two fitness values and returns:
// a, -1 if the first fitness value lower then the second
// b. 0 if the fitness values are equal
// c. 1 if the first fitness value is greater then the second
virtual int GACALL operator ()(float fitness1,
float fitness2) const;
};// END CLASS DEFINITION GaMaxFitnessComparator
} // FitnessComparators
} // Chromosome
#endif // __GA_FITNESS_COMPARATORS_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -