-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCParams.h
More file actions
88 lines (63 loc) · 1.73 KB
/
CParams.h
File metadata and controls
88 lines (63 loc) · 1.73 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef CPARAMS_H
#define CPARAMS_H
//------------------------------------------------------------------------
//
// Name: CParams.h
//
// Author: Mat Buckland 2002
//
// Desc: Class to hold all the parameters used in this project. The values
// are loaded in from an ini file when an instance of the class is
// created.
//
//
//------------------------------------------------------------------------
#include <fstream>
#include <windows.h>
#include <string>
#include <algorithm>
#include <functional>
#include <cctype>
#include <locale>
class CParams
{
public:
//------------------------------------general parameters
static double dPi;
static double dHalfPi;
static double dTwoPi;
static int WindowWidth;
static int WindowHeight;
static int iFramesPerSecond;
//--------------------------------------used to define the sweepers
//limits how fast the sweepers can turn
static double dMaxTurnRate;
static double dMaxSpeed;
//for controlling the size
static int iSweeperScale;
//--------------------------------------controller parameters
static int iNumSweepers;
static int iNumMines;
static int iNumSuperMines;
static int iNumRocks;
//number of time steps we allow for each generation to live
static int iNumTicks;
//scaling factor for mines
static double dMineScale;
//used for elitism
static int iNumElite;
static int iNumCopiesElite;
static bool bDiscreteGrid;
static int iGridCellDim;
static std::string sTrainingFilename;
//ctor
CParams()
{
if(!LoadInParameters("params.ini"))
{
MessageBox(NULL, "Cannot find ini file!", "Error", 0);
}
}
bool LoadInParameters(char* szFileName);
};
#endif