?? gaincrementalalgorithm.h
字號:
#ifndef __GA_INCREMENTAL_ALGORITHM_H__
#define __GA_INCREMENTAL_ALGORITHM_H__
#include <vector>
#include "..\..\ExportImport.h"
#include "..\..\CallConvention.h"
#include "..\..\Threading\GaThreading.h"
#include "..\GaMultithreadingAlgorithm.h"
namespace Population
{
class GaPopulation;
}
using namespace std;
using namespace Threading;
using namespace Population;
using namespace Algorithm;
namespace Algorithm
{
namespace SimpleAlgorithms
{
// Use overlapping population, only few chromosomes are repaced in single generation
class GaIncrementalAlgorithm : public GaMultithreadingAlgorithm
{
private:
// Algorithm's parameters
GaMultithreadingAlgorithmParams _parameters;
// Population
GaPopulation* _population;
// Buffer for selection and coupling operations
GaCouplingResultSet* _buffer;
public:
// Initialize algorithm
DLL_EXPORT
GaIncrementalAlgorithm(GaPopulation* population,
const GaMultithreadingAlgorithmParams& parameters);
// Free resources
DLL_EXPORT
virtual ~GaIncrementalAlgorithm();
// Returns current algorithm parameters
DLL_EXPORT
virtual const GaAlgorithmParams& GACALL GetAlgorithmParameters() const;
// Sets new parameters for algorithm
DLL_EXPORT
virtual void GACALL SetAlgorithmParameters(const GaAlgorithmParams& parameters);
// Returns referenct to population at given index.
DLL_EXPORT
virtual const GaPopulation& GACALL GetPopulation(int index) const;
// Retruns statistical information about execution of the algorithm.
DLL_EXPORT
virtual const GaStatistics& GACALL GetAlgorithmStatistics() const;
protected:
// Initialize the algorithm
DLL_EXPORT
virtual void GACALL Initialize();
// Step of control flow before workers start
DLL_EXPORT
virtual void GACALL BeforeWorkers();
// One step of work flow
DLL_EXPORT
virtual void GACALL WorkStep(int workerId);
// Step of control flow after workers finish
DLL_EXPORT
virtual void GACALL AfterWorkers();
};// END CLASS DEFINITION GaIncrementalAlgorithm
} // SimpleAlgorithms
} // Algorithm
#endif // __GA_INCREMENTAL_ALGORITHM_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -