-
Notifications
You must be signed in to change notification settings - Fork 1
/
heuristic.py
66 lines (64 loc) · 2.69 KB
/
heuristic.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
from heuristics.h1_1_A import h_1_1_A
from heuristics.h1_1_B import h_1_1_B
from heuristics.h1_1_C import h_1_1_C
from heuristics.h1_1_D import h_1_1_D
from heuristics.h1_1_E import h_1_1_E
from heuristics.h1_1_F import h_1_1_F
from heuristics.h1_2_A import h_1_2_A
from heuristics.h1_2_B import h_1_2_B
from heuristics.h1_2_C import h_1_2_C
from heuristics.h1_2_D import h_1_2_D
from heuristics.h1_2_E import h_1_2_E
from heuristics.h1_3_A import h_1_3_A
from heuristics.h1_3_B import h_1_3_B
from heuristics.h1_4_A import h_1_4_A
from heuristics.h1_4_B import h_1_4_B
from heuristics.h2_2 import h_2_2
from heuristics.h2_21 import h_2_21
from heuristics.h2_28 import h_2_28
from heuristics.regression import regression
class Heuristic:
def __init__(self):
self.problem = 1
def rate(self, heuristic, input, output, output_generated, best_fitness = None, len_input = None):
match heuristic:
case '1.1.A':
return h_1_1_A(input, output, output_generated)
case '1.1.B':
return h_1_1_B(input, output, output_generated)
case '1.1.C':
return h_1_1_C(input, output, output_generated)
case '1.1.D':
return h_1_1_D(input, output, output_generated)
case '1.1.E':
return h_1_1_E(input, output, output_generated)
case '1.1.F':
return h_1_1_F(input, output, output_generated)
case '1.2.A':
return h_1_2_A(input, output, output_generated)
case '1.2.B':
return h_1_2_B(input, output, output_generated)
case '1.2.C':
return h_1_2_C(input, output, output_generated)
case '1.2.D':
return h_1_2_D(input, output, output_generated)
case '1.2.E':
return h_1_2_E(input, output, output_generated)
case '1.3.A':
return h_1_3_A(input, output, output_generated)
case '1.3.B':
return h_1_3_B(input, output, output_generated)
case '1.4.A':
return h_1_4_A(input, output, output_generated)
case '1.4.B':
return h_1_4_B(input, output, output_generated)
case '2.2':
return h_2_2(input, output, output_generated, best_fitness, len_input)
case '2.21':
return h_2_21(input, output, output_generated, best_fitness, len_input)
case '2.28':
return h_2_28(input, output, output_generated, best_fitness, len_input)
case 'regression':
return regression(input, output, output_generated)
case _:
return 0