-
Notifications
You must be signed in to change notification settings - Fork 0
/
ga.h
57 lines (48 loc) · 1.47 KB
/
ga.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//#include "network.h"
#include <iostream>
#include <cstdlib>
#include <vector>
using namespace std;
//#include"globev.h"
#include "evgame.h"
class GAgame
{
//DATA OF GAGAME
public:
GAgame( int gamet,int imitt,int synct,int mem, const vector<vector<int> > &vTemp);
~GAgame();
int Strtinit();
int Hstinit(double rt=0.5);
int Fitinit();
double Game(double dg,double dr);//
int Gameas(double dg);
double Gamemob(double dg,double dr);
int Gameasmob(double dg);
int Pfpmob();
int ruleupdate(double dg,double dr); //更新规则
//各类模仿规则 ,由 ruleupdate来选择调用
int imitdyns(double dg,double dr);
int imitmaxs();
int imitrands();
int imitgas();
int imitdynas(double b);
int imitmaxas();
int imitrandas(); //
int imitgaas();
int imitrandomdys(double b);
double getpayoff();
int Infoprint();
double getCratioas();
vector<vector<unsigned> > GameHistory; //博弈历史
vector<vector<double> > Pfmx; //payoff 矩阵
vector<vector<int> > Strategy; //策略
vector<vector<int> > MidStrategy; //中间策略保存
vector<double> Fitness; //计算适应度
vector<vector<int> > GameCountmx; //博弈轮数
const vector<vector<int> > &vLadj; //邻接矩阵
int Randnode;
int Gsize, GAMETYPE, MEM, MEMLEN,GLOOP,nImitType,nSyncType;//game loops in one generation
//int ILOOP;// I loop times in main rerun the whole sytem repeat times
//int JLOOP;//k loop times in main ,Gene algrithm generations
private:
};