-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.h
54 lines (40 loc) · 1.17 KB
/
input.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
#ifndef __INPUT_H__
#define __INPUT_H__
#include <stdio.h>
#include <string>
#include <unistd.h>
#include "action.h"
#include "globalmin/simulatedAnnealing/simulatedAnnealing.h"
#include "globalmin/batch.h"
#define SIMULATED_ANNEALING 0
#define RANDOM_SEARCH 1
#define PARTICLE_SWARM_OPTIMIZATION 2
#define GENETIC_ALGORITHM 3
#define BATCH 4
class Input {
public:
std::string m_sFileName;
std::string m_sVersion;
int m_iAction; // SIMULATED_ANNEALING, RANDOM_SEARCH, PARTICLE_SWARM_OPTIMIZATION, etc.
Action *m_pAction;
Input();
~Input();
bool load(const char* pFilename);
bool loadStr(char* xml);
bool load(rapidxml::xml_document<> &doc);
bool save(rapidxml::xml_document<> &doc);
bool save(const char* pFilename);
bool save();
bool save(std::string &buffer);
const char* getXml();
bool run(const char* fileName);
static bool s_bCompactXml;
private:
static const char* s_agml;
static const char* s_attributeNames[];
static const bool s_required[];
static const char* s_defaultValues[];
static const char* s_actionElementNames[];
void clear();
};
#endif