-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
112 lines (99 loc) · 3.73 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Hosein Hadipour
# June 13, 2019
# 23 Khordad, 1398
from craftst import Craft
if __name__ == "__main__":
#########################################################
# 6 rounds BMD for CRAFT with probability one:
r0, w0 = 0, 1
r1, w1 = 1, 2
rm, wm = 5, 1
number_of_patterns = 1
# Solution number 0
# Upper activeness pattern:
# x0: 1000000010000000 y0: 0000000010000000
# x1: 0000001000000000 y1: 0000001000000000
# x2: 0000000010000000 y2: 1000000010000000
# x3: 0000001000000001 y3: 0001001100000001
# x4: 1000000010010010 y4: 0011001010010010
# x5: 0001001110000110
# Lower activeness pattern:
# x0: 1111110100101001 y0: 0100110000101001
# x1: 1100100001101000 y1: 0010000001101000
# x2: 0100110000000100 y2: 0000100000000100
# x3: 0010000000100000 y3: 0000000000100000
# x4: 0000100000000000 y4: 0000100000000000
# x5: 0000000000100000
# Linking variables:
# 00000000000000
# 00000000000000
# 00000000000000
# 00000000000000
# 00000000000000
# Time used = 0.0681607723236084
#########################################################
#########################################################
# Dedicated 14 rounds BMD for CRAFT (solution number 9):
# r0, w0 = 6, 4
# r1, w1 = 6, 4
# rm, wm = 2, 2
# number_of_patterns = 10
# Solution number 9
# Upper activeness pattern:
# x0: 1011001010010010 y0: 1000000010010010
# x1: 0001001100000001 y1: 0000001000000001
# x2: 1000000010000000 y2: 0000000010000000
# x3: 0000001000000000 y3: 0000001000000000
# x4: 0000000010000000 y4: 1000000010000000
# x5: 0000001000000001 y5: 0001001100000001
# x6: 1000000010010010 y6: 0011001010010010
# x7: 0001001110000110 y7: 1111010110000110
# x8: 0011001001011111
# Lower activeness pattern:
# x0: 1111010100101001 y0: 0100110000101001
# x1: 1100100001101000 y1: 0010000001101000
# x2: 0100110000000100 y2: 0000100000000100
# x3: 0010000000100000 y3: 0000000000100000
# x4: 0000100000000000 y4: 0000100000000000
# x5: 0000000000100000 y5: 0010000000100000
# x6: 0000100000000100 y6: 0100110000000100
# x7: 0010000001101000
# Linking variables:
# 01000100000000
# 00000001001000
# Time used = 34.50758695602417
#########################################################
#########################################################
# 9-14 rounds BMDs for CRAFT:
# r0, w0 = 6, 1
# r1, w1 = 6, 1
# rm, wm = 2, 1
# number_of_patterns = 1
# Solution number 0
# Upper activeness pattern:
# x0: 0111000101100001 y0: 0100000001100001
# x1: 1000110000001000 y1: 0000010000001000
# x2: 0100000001000000 y2: 0000000001000000
# x3: 0000010000000000 y3: 0000010000000000
# x4: 0000000001000000 y4: 0100000001000000
# x5: 0000010000001000 y5: 1000110000001000
# x6: 0100000001100001 y6: 0011000101100001
# x7: 1000110000010110 y7: 1111101000010110
# x8: 0011000110101111
# Lower activeness pattern:
# x0: 0011000101100001 y0: 0100000001100001
# x1: 1000110000001000 y1: 0000010000001000
# x2: 0100000001000000 y2: 0000000001000000
# x3: 0000010000000000 y3: 0000010000000000
# x4: 0000000001000000 y4: 0100000001000000
# x5: 0000010000001000 y5: 1000110000001000
# x6: 0100000001100001 y6: 0011000101100001
# x7: 1000110000010110
# Linking variables:
# 00000000000000
# 00000000001000
# Time used = 1.4159741401672363
#########################################################
craft = Craft(r0, r1, rm, w0, w1, wm, number_of_patterns)
craft.make_model()
craft.solve_model()