-
Notifications
You must be signed in to change notification settings - Fork 0
/
SATInstance.h
49 lines (33 loc) · 1.08 KB
/
SATInstance.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
//
// Created by Dominik Plíšek on 22/01/16.
//
#ifndef PAA_EXAM_SATINSTANCE_H
#define PAA_EXAM_SATINSTANCE_H
static const int maxWeight = 10;
static const double warmingFactor = 1.5;
#include <vector>
#include "SATClause.h"
using namespace std;
class SATEvaluation;
class SATInstance {
int step;
bool getLine(istream &in, string &line);
void considerEvaluation(SATEvaluation ¤t, SATEvaluation &best, double temp, int &accepted, int &processed, bool simulation);
bool acceptingEnough(int accepted, int processed);
bool isFrozen(int accepted, int processed);
public:
SATClause **clauses;
vector<SATClause *> *clausePresence;
int variableCount;
int clauseCount;
int clauseSize;
int *weights;
double coolingFactor;
SATInstance(int clauseSize);
virtual ~SATInstance();
friend istream& operator >> (istream& in, SATInstance &instance);
bool solve(SATEvaluation &output);
double getValueToOptimize(SATEvaluation &evaluation);
void revert(SATEvaluation &evaluation, int index);
};
#endif //PAA_EXAM_SATINSTANCE_H