-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtoy.py
66 lines (52 loc) · 1.61 KB
/
toy.py
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
FnameCSV = "toy.csv"
FnameASP = "toy.asp"
LowerBoundInputs = 1
UpperBoundInputs = 10
LowerBoundGates = 1
UpperBoundGates = 2
GateTypes = [{"LowerBoundPos":0,"UpperBoundPos":2,
"LowerBoundNeg":0,"UpperBoundNeg":0,
"UpperBoundOcc":1},
{"LowerBoundPos":0,"UpperBoundPos":0,
"LowerBoundNeg":0,"UpperBoundNeg":1,
"UpperBoundOcc":2}]
EfficiencyConstraint = False
OptimizationStrategy = 1
BreakSymmetries = True
Silent = False
UniquenessConstraint = False
PerfectClassifier = True
UpperBoundFalsePos = 0
UpperBoundFalseNeg = 0
import classifier
if __name__=="__main__":
if 1:
classifier.csv2asp(
FnameCSV,
FnameASP,
LowerBoundInputs,
UpperBoundInputs,
LowerBoundGates,
UpperBoundGates,
GateTypes,
EfficiencyConstraint,
OptimizationStrategy,
BreakSymmetries,
Silent,
UniquenessConstraint,
PerfectClassifier,
UpperBoundFalsePos,
UpperBoundFalseNeg)
if 1:
GateInputs = "gate_input(1,positive,g2) gate_input(2,positive,g3) gate_input(2,negative,g1)"
classifier.check_classifier(FnameCSV, GateInputs)
if 1:
GateInputs = "gate_input(1,positive,g2) gate_input(2,positive,g3) gate_input(2,negative,g1)"
Fname = "toy.pdf"
classifier.gateinputs2pdf(Fname, GateInputs)
if 0:
FnameMAT = "toy.mat"
Threshold = 250
classifier.mat2csv(FnameMAT, Threshold)
if 1:
classifier.check_csv(FnameCSV)