-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
78 lines (48 loc) · 2.07 KB
/
main.cpp
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
58
59
60
61
62
63
#include <iostream>
#include "NashGame.h"
int main() {
int row, col;
std::cerr << "What is the number of rows in the matrix?" << std::endl;
std::cin >> row;
std::cerr << "What is the number of columns in the matrix?" << std::endl;
std::cin >> col;
//==================================================================================================//
std::cerr << "Enter values for the payoff matrix of the row player (player 1): " << std::endl;
std::vector<std::vector<double>> row_payoff( row , std::vector<double> (col, 0));
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
std::cerr << "row_payoff[" << i << "][" << j << "]" << std::endl;
std::cin >> row_payoff[i][j];
}
}
//==================================================================================================//
//==================================================================================================//
std::cerr << "Enter values for the payoff matrix of the column player (player 2): " << std::endl;
std::vector<std::vector<double>> col_payoff( row , std::vector<double> (col, 0));
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
std::cerr << "col_payoff[" << i << "][" << j << "]" << std::endl;
std::cin >> col_payoff[i][j];
}
}
//==================================================================================================//
/*
std::vector<std::vector<double>> row_payoff;
std::vector<std::vector<double>> col_payoff;
std::vector<double> row_row_1{ 1, 1, -1 };
std::vector<double> row_row_2{ 2,-1, 0 };
row_payoff.push_back(row_row_1);
row_payoff.push_back(row_row_2);
std::vector<double> col_row_1{ 0.5, -1, 0.5 };
std::vector<double> col_row_2{ -1, 3, 2 };
col_payoff.push_back(col_row_1);
col_payoff.push_back(col_row_2);
*/
NashGame NG(row_payoff, col_payoff);
NG.support_enumeration();
return 0;
}