NANA
population.h
浏览该文件的文档.
1#pragma once
15#include "gene.h"
16#include <list>
17
18
19namespace NANA {
20namespace GA {
21
23public:
24
28 struct CResult {
29 double val;
30 int index;
31 };
32
33
34
35 Popultation(int groupNumber, int mutate);
36
41 void run(int iterNum);
42
43
44
45protected:
49 void choose();
50
54 void update();
57 std::vector<GeneFloat> m_members;
58 std::vector<GeneFloat> m_oldmembers;
59 std::vector<CResult> m_result;
60 std::list<int> m_lives;
61};
62
63
64
65
66}
67}
int m_mutate
百分之
Definition: population.h:56
int m_groupNumber
种群数量
Definition: population.h:55
std::vector< CResult > m_result
上一代的成员
Definition: population.h:59
std::list< int > m_lives
活下来的个体
Definition: population.h:60
std::vector< GeneFloat > m_members
成员
Definition: population.h:57
#define NA_API
兼容windows系统与linux系统
Definition: core_global.h:24
实现基因的运算
记录结果和序号
Definition: population.h:28