Skip to content

Commit

Permalink
final
Browse files Browse the repository at this point in the history
  • Loading branch information
coado committed Feb 2, 2024
1 parent 5ee7bd2 commit c07ba51
Show file tree
Hide file tree
Showing 26 changed files with 2,403 additions and 102 deletions.
38 changes: 19 additions & 19 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Config:
def __init__(self):

self.data = 'data.txt'
self.heuristic = '1.1.B'
self.data = 'k_10.txt'
self.heuristic = 'regression'

self.max_interpreter_steps = 1000

Expand All @@ -23,11 +23,11 @@ def __init__(self):
# 0 means no complexity
# 1 means max complexity
self.complexity_of_operations = 0.3
self.complexity_of_logic = 0.3
self.complexity_of_logic = 0.4

self.population = 100
self.population = 10
self.generations = 100
self.tournament_size = 40
self.tournament_size = 3

self.not_prob = 30
self.evolution_prob = {
Expand All @@ -39,30 +39,30 @@ def __init__(self):
self.mut_prob_per_node = 10

self.block_prob = {
'equation': 25,
'while': 25,
'if': 25,
'output': 25,
'equation': 20,
'while': 0,
'if': 50,
'output': 30,
}

# Use more vars or consts?
self.operation_prob = {
'variable': 45,
'constant': 45,
'input': 10,
'variable': 50,
'constant': 0,
'input': 50,
}

self.condition_prob = {
'operation': 20,
'true': 40,
'false': 40,
'input': 0,
'operation': 0,
'true': 33,
'false': 33,
'input': 34,
}

self.equation_prob = {
'operation': 34,
'logic': 33,
'input': 33,
'operation': 0,
'logic': 50,
'input': 50,
}

self.syntax = {
Expand Down
50 changes: 50 additions & 0 deletions data/data2_2 copy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
2453 : 2
528 : 0
2737 : 2
1390 : 1
305 : 0
2130 : 2
1190 : 1
2282 : 2
426 : 0
953 : 0
1422 : 1
2303 : 2
1322 : 1
480 : 0
2161 : 2
1469 : 1
2620 : 2
2976 : 2
2361 : 2
192 : 0
777 : 0
1126 : 1
1225 : 1
860 : 0
510 : 0
808 : 0
2815 : 2
728 : 0
780 : 0
1629 : 1
1284 : 1
2402 : 2
1978 : 1
32 : 0
2724 : 2
2804 : 2
2137 : 2
2424 : 2
205 : 0
2835 : 2
2879 : 2
1867 : 1
2770 : 2
512 : 0
800 : 0
1669 : 1
2089 : 2
434 : 0
1089 : 1
592 : 0
47 changes: 1 addition & 46 deletions data/data2_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,4 @@
528 : 0
2737 : 2
1390 : 1
305 : 0
2130 : 2
1190 : 1
2282 : 2
426 : 0
953 : 0
1422 : 1
2303 : 2
1322 : 1
480 : 0
2161 : 2
1469 : 1
2620 : 2
2976 : 2
2361 : 2
192 : 0
777 : 0
1126 : 1
1225 : 1
860 : 0
510 : 0
808 : 0
2815 : 2
728 : 0
780 : 0
1629 : 1
1284 : 1
2402 : 2
1978 : 1
32 : 0
2724 : 2
2804 : 2
2137 : 2
2424 : 2
205 : 0
2835 : 2
2879 : 2
1867 : 1
2770 : 2
512 : 0
800 : 0
1669 : 1
2089 : 2
434 : 0
1089 : 1
592 : 0
305 : 0
20 changes: 20 additions & 0 deletions data/data2_21.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-540 636 -541 -102 603 -980 -6 -813 545 -554 : 0 636 0 0 603 0 0 0 545 0
935 -707 425 884 -668 512 : 935 0 425 884 0 512
-638 490 500 -916 391 826 557 253 -496 561 : 0 490 500 0 391 826 557 253 0 561
-217 -978 451 -729 487 274 -695 -704 748 : 0 0 451 0 487 274 0 0 748
-386 -478 -441 597 581 : 0 0 0 597 581
187 -679 603 -657 : 187 0 603 0
-16 -485 -847 -620 51 : 0 0 0 0 51
-868 -53 -183 973 -252 : 0 0 0 973 0
-216 -163 : 0 0
41 424 -996 597 -79 985 -214 -299 -275 699 : 41 424 0 597 0 985 0 0 0 699
676 822 43 349 955 408 : 676 822 43 349 955 408
983 227 -793 823 734 -759 -708 : 983 227 0 823 734 0 0
347 : 347
25 -795 : 25 0
-800 167 -128 -971 856 -864 -391 : 0 167 0 0 856 0 0
-914 -211 828 -935 -265 : 0 0 828 0 0
419 -600 684 : 419 0 684
541 -97 -284 496 338 -413 : 541 0 0 496 338 0
-837 916 -96 182 714 596 -297 -724 -340 : 0 916 0 182 714 596 0 0 0
-748 : 0
20 changes: 20 additions & 0 deletions data/data2_28.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-31 -35 -4 510 : -35
272 367 514 311 : 272
122 421 58 52 : 52
654 74 177 253 : 74
164 169 373 567 : 164
919 905 782 737 : 737
996 322 802 84 : 84
-17 517 208 995 : -17
191 -77 50 12 : -77
765 60 784 810 : 60
592 914 100 -8 : -8
359 -59 940 48 : -59
859 498 849 -52 : -52
389 232 714 -88 : -88
132 909 -81 -72 : -81
36 171 -62 417 : -62
404 542 769 -28 : -28
-64 985 919 185 : -64
543 622 754 -62 : -62
249 85 -68 374 : -68
4 changes: 4 additions & 0 deletions data/k_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0 : 1
1 : 0

var2 = 1;var0 = (((not false) > input) and ((not false) == true));if ((var1 < -663)) { var0 = -169; }output var0;
Loading

0 comments on commit c07ba51

Please sign in to comment.