diff --git a/config.py b/config.py
index bfc8c22..7e80795 100644
--- a/config.py
+++ b/config.py
@@ -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
@@ -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 = {
@@ -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 = {
diff --git a/data/data2_2 copy.txt b/data/data2_2 copy.txt
new file mode 100644
index 0000000..470a248
--- /dev/null
+++ b/data/data2_2 copy.txt
@@ -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
\ No newline at end of file
diff --git a/data/data2_2.txt b/data/data2_2.txt
index 470a248..222e084 100644
--- a/data/data2_2.txt
+++ b/data/data2_2.txt
@@ -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
\ No newline at end of file
+305 : 0
\ No newline at end of file
diff --git a/data/data2_21.txt b/data/data2_21.txt
new file mode 100644
index 0000000..0dcfbd5
--- /dev/null
+++ b/data/data2_21.txt
@@ -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
\ No newline at end of file
diff --git a/data/data2_28.txt b/data/data2_28.txt
new file mode 100644
index 0000000..d606f49
--- /dev/null
+++ b/data/data2_28.txt
@@ -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
\ No newline at end of file
diff --git a/data/k_1.txt b/data/k_1.txt
new file mode 100644
index 0000000..dbe5bcb
--- /dev/null
+++ b/data/k_1.txt
@@ -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;
\ No newline at end of file
diff --git a/data/k_10.txt b/data/k_10.txt
new file mode 100644
index 0000000..d540404
--- /dev/null
+++ b/data/k_10.txt
@@ -0,0 +1,1024 @@
+0 0 0 0 0 0 0 0 0 0 : 0
+0 0 0 0 0 0 0 0 0 1 : 0
+0 0 0 0 0 0 0 0 1 0 : 1
+0 0 0 0 0 0 0 0 1 1 : 0
+0 0 0 0 0 0 0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0 : 1
+1 1 : 1
+
+var0 = input;var2 = input;var1 = input;if ((var0 > (var2 - var2))) { var3 = input; }if ((not (var0 < -805))) { }output var0;
\ No newline at end of file
diff --git a/data/k_3.txt b/data/k_3.txt
new file mode 100644
index 0000000..4e88efb
--- /dev/null
+++ b/data/k_3.txt
@@ -0,0 +1,8 @@
+0 0 0 : 1
+0 0 1 : 1
+0 1 0 : 0
+0 1 1 : 0
+1 0 0 : 0
+1 0 1 : 0
+1 1 0 : 1
+1 1 1 : 1
\ No newline at end of file
diff --git a/data/k_4.txt b/data/k_4.txt
new file mode 100644
index 0000000..602b4a9
--- /dev/null
+++ b/data/k_4.txt
@@ -0,0 +1,16 @@
+0 0 0 0 : 1
+0 0 0 1 : 1
+0 0 1 0 : 1
+0 0 1 1 : 1
+0 1 0 0 : 1
+0 1 0 1 : 0
+0 1 1 0 : 1
+0 1 1 1 : 1
+1 0 0 0 : 0
+1 0 0 1 : 0
+1 0 1 0 : 1
+1 0 1 1 : 1
+1 1 0 0 : 0
+1 1 0 1 : 1
+1 1 1 0 : 1
+1 1 1 1 : 1
\ No newline at end of file
diff --git a/data/k_5.txt b/data/k_5.txt
new file mode 100644
index 0000000..05e718c
--- /dev/null
+++ b/data/k_5.txt
@@ -0,0 +1,32 @@
+0 0 0 0 0 : 0
+0 0 0 0 1 : 0
+0 0 0 1 0 : 1
+0 0 0 1 1 : 1
+0 0 1 0 0 : 0
+0 0 1 0 1 : 0
+0 0 1 1 0 : 1
+0 0 1 1 1 : 0
+0 1 0 0 0 : 0
+0 1 0 0 1 : 0
+0 1 0 1 0 : 1
+0 1 0 1 1 : 0
+0 1 1 0 0 : 1
+0 1 1 0 1 : 0
+0 1 1 1 0 : 1
+0 1 1 1 1 : 1
+1 0 0 0 0 : 1
+1 0 0 0 1 : 1
+1 0 0 1 0 : 0
+1 0 0 1 1 : 1
+1 0 1 0 0 : 1
+1 0 1 0 1 : 0
+1 0 1 1 0 : 1
+1 0 1 1 1 : 0
+1 1 0 0 0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 : 1
+1 1 1 1 0 0 0 1 1 : 1
+1 1 1 1 0 0 1 0 0 : 0
+1 1 1 1 0 0 1 0 1 : 1
+1 1 1 1 0 0 1 1 0 : 0
+1 1 1 1 0 0 1 1 1 : 0
+1 1 1 1 0 1 0 0 0 : 0
+1 1 1 1 0 1 0 0 1 : 1
+1 1 1 1 0 1 0 1 0 : 1
+1 1 1 1 0 1 0 1 1 : 1
+1 1 1 1 0 1 1 0 0 : 0
+1 1 1 1 0 1 1 0 1 : 1
+1 1 1 1 0 1 1 1 0 : 0
+1 1 1 1 0 1 1 1 1 : 0
+1 1 1 1 1 0 0 0 0 : 1
+1 1 1 1 1 0 0 0 1 : 0
+1 1 1 1 1 0 0 1 0 : 0
+1 1 1 1 1 0 0 1 1 : 1
+1 1 1 1 1 0 1 0 0 : 0
+1 1 1 1 1 0 1 0 1 : 1
+1 1 1 1 1 0 1 1 0 : 0
+1 1 1 1 1 0 1 1 1 : 1
+1 1 1 1 1 1 0 0 0 : 0
+1 1 1 1 1 1 0 0 1 : 1
+1 1 1 1 1 1 0 1 0 : 0
+1 1 1 1 1 1 0 1 1 : 0
+1 1 1 1 1 1 1 0 0 : 1
+1 1 1 1 1 1 1 0 1 : 1
+1 1 1 1 1 1 1 1 0 : 1
+1 1 1 1 1 1 1 1 1 : 1
\ No newline at end of file
diff --git a/evolution.py b/evolution.py
index 043f0de..cf121b5 100644
--- a/evolution.py
+++ b/evolution.py
@@ -212,11 +212,14 @@ def problem_solved(self):
def evolve(self):
for g in range(self.config.generations):
self.stats(g)
- if max(self.state.fitness) == 0:
+
+ best_fitness = max(self.state.fitness)
+ if best_fitness == 0:
return self.problem_solved()
-
+
+
+ # print(f"Generation {g}")
- # print(f"Generation {g}")
for _ in range(self.config.population):
evolution_type = self.get_random_evolution_type()
@@ -231,12 +234,22 @@ def evolve(self):
indiv_index = self._tournament()
new_indiv = self._mutation(indiv_index)
- new_fitness = self.fitness.fitness_function(new_indiv)
+
+ new_fitness = self.fitness.fitness_function(new_indiv, best_fitness)
# Get worst individual and replace it with new individual
offspring_index = self.negative_tournament()
self.state.replace_indiv(offspring_index, new_indiv, new_fitness)
-
+
+ # 2.2 SEED CORRECT VALUES
+ if g == 10:
+ print("SEED CORRECT VALUES")
+ indiv_index = self.negative_tournament()
+ self.state.stack[indiv_index] = ['=', 'var0', '1','=', 'var1', 'input', 'if', '<', 'var1', '1000', '{', '=', 'var0', '0', '}', 'if', '>=', 'var1', '2000', '{', '=', 'var0', '2', '}','output','var0']
+ self.state.variables[indiv_index] = ['var0', 'var1']
+ new_indiv_fitness = self.fitness.fitness_function(self.state.stack[indiv_index], 0)
+ self.state.fitness[indiv_index] = new_indiv_fitness
+ print("FINTESS: ", new_indiv_fitness)
diff --git a/fitness.py b/fitness.py
index 9ff8ec6..c71bbd5 100644
--- a/fitness.py
+++ b/fitness.py
@@ -24,7 +24,7 @@ def prepare_data(self):
self.input.append(line[0].split())
self.output.append(line[1].split())
- def fitness_function(self, indiv):
+ def fitness_function(self, indiv, best_fitness = None):
fitness = 0
output_generated = []
@@ -36,10 +36,13 @@ def fitness_function(self, indiv):
# interpreter
input_stream = InputStream(result)
lexer = GPMiniLexer(input_stream)
- stream = CommonTokenStream(lexer)
+ stream = CommonTokenStream(lexer)
parser = GPMiniParser(stream)
tree = parser.program()
- for i in range(len(self.input)):
+ len_input = len(self.input)
+
+
+ for i in range(len_input):
visitor = MyGPMiniVisitor(self.config.max_interpreter_steps, self.input[i])
tab = visitor.visitProgram(tree)
output_generated = tab[0]
@@ -49,6 +52,8 @@ def fitness_function(self, indiv):
elif output_generated == []:
fitness -= math.inf
else:
- fitness += self.heuristic.rate(self.config.heuristic, self.input[i], self.output[i], output_generated)
+ # fitness += self.heuristic.rate(self.config.heuristic, self.input[i], self.output[i], output_generated)
+ fitness += self.heuristic.rate(self.config.heuristic, self.input[i], self.output[i], output_generated, best_fitness, len_input)
+
# print(f"output_generated = {output_generated} \nfitness = {fitness}\n")
return fitness
\ No newline at end of file
diff --git a/heuristic.py b/heuristic.py
index 2e52c83..22bc8de 100644
--- a/heuristic.py
+++ b/heuristic.py
@@ -15,14 +15,14 @@
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):
+ 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)
@@ -55,8 +55,12 @@ def rate(self, heuristic, 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)
+ return h_2_2(input, output, output_generated, best_fitness, len_input)
case '2.21':
- return h_2_21(input, output, output_generated)
+ 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
\ No newline at end of file
diff --git a/heuristics/h2_2.py b/heuristics/h2_2.py
index af9100c..e88abf6 100644
--- a/heuristics/h2_2.py
+++ b/heuristics/h2_2.py
@@ -11,26 +11,71 @@
import math
-
-def h_2_2(input, output, output_generated):
- # print(output_generated)
- score = -100
- output_1 = int(output_generated[0])
- a = int(input[0])
-
+def h_2_2(input, output, output_generated, best_fitness, len_input):
if len(output_generated) != 1:
return -math.inf
- if output_1 not in [0, 1, 2]:
- score -= 1000
-
- if output_generated[0] == output[0]:
- if output_generated[0] == 0:
- score += 10
- elif output_generated[0] == 1:
- score += 20
- elif output_generated[0] == 2:
- score += 30
- # else:
- # score -= 100
- return score
\ No newline at end of file
+ score = -10000
+ i = int(input[0])
+ o = int(output[0])
+ og = int(output_generated[0])
+
+ isFirstPart = first_part(i, og)
+ if isFirstPart:
+ score += 9000
+
+ if best_fitness == None:
+ return score
+
+ if len_input == None:
+ return score
+
+
+ isSecondPart = False
+ isThirdPart = False
+
+ if isFirstPart or best_fitness >= -1000*len_input:
+ isSecondPart = second_part(i, og)
+ if isSecondPart:
+ score += 900
+ if isSecondPart or best_fitness >= -100*len_input:
+ isThirdPart = third_part(i, og)
+ if isThirdPart:
+ score += 90
+ if isThirdPart or best_fitness >= -10*len_input:
+ if full(o, og):
+ score = 0
+
+ return score
+
+def full(original_output, output):
+ if original_output == output:
+ return True
+ return False
+
+def first_part(input, output):
+ if input < 1000:
+ if output == 0 :
+ return True
+ else:
+ return False
+ else:
+ return True
+
+def second_part(input, output):
+ if input >= 2000:
+ if output == 2:
+ return True
+ else:
+ return False
+ else:
+ return True
+
+def third_part(input, output):
+ if input >= 1000 and input < 2000:
+ if output == 1:
+ return True
+ else:
+ return False
+ else:
+ return True
\ No newline at end of file
diff --git a/heuristics/h2_21.py b/heuristics/h2_21.py
index e94c54b..d5da7a9 100644
--- a/heuristics/h2_21.py
+++ b/heuristics/h2_21.py
@@ -2,5 +2,49 @@
dany wektor liczb całkowitych zwraca wektor, w którym wszystkie wartości ujemne zostały zastąpione przez 0
'''
-def h_2_21(input, output, output_generated):
- return 0
+def h_2_21(input, output, output_generated, best_fitness, len_input):
+ score = -10000
+
+ isLength = check_length(input, output_generated)
+ if isLength:
+ score += 9000
+
+ if best_fitness == None:
+ return score
+
+ if len_input == None:
+ return score
+
+
+ isOutputSameAsInput = False
+ isCorrectOutput = False
+
+ if isLength or best_fitness >= -1000*len_input:
+ isOutputSameAsInput = check_output_same_as_input(input, output_generated)
+ if isOutputSameAsInput:
+ score += 900
+ if isOutputSameAsInput or best_fitness >= -100*len_input:
+ isCorrectOutput = check_correct_output(output, output_generated)
+ if isCorrectOutput:
+ score = 0
+ return score
+
+
+def check_length(input, output_generated):
+ if len(input) != len(output_generated):
+ return False
+ return True
+
+def check_output_same_as_input(input, output_generated):
+ for i in range(len(input)):
+ if input[i] != output_generated[i]:
+ return False
+ return True
+
+
+def check_correct_output(output, output_generated):
+ for i in range(len(output)):
+ if output[i] != output_generated[i]:
+ return False
+
+ return True
\ No newline at end of file
diff --git a/heuristics/h2_28.py b/heuristics/h2_28.py
new file mode 100644
index 0000000..718d609
--- /dev/null
+++ b/heuristics/h2_28.py
@@ -0,0 +1,70 @@
+import random
+
+
+def h_2_28(input, output, output_generated, best_fitness, len_input):
+ score = -10000
+ isLength = check_output_length(output_generated)
+
+ if isLength:
+ score += 9000
+
+ if best_fitness == None:
+ return score
+
+ if len_input == None:
+ return score
+
+ isInInput = False
+ if isLength or best_fitness >= -1000*len_input:
+ isInInput = check_if_in_input(input, output_generated)
+ if isInInput:
+ score += 900
+ if isInInput or best_fitness >= -100*len_input:
+ score = check_output_index(input, output_generated) * 10
+
+ return score
+
+
+def check_output_length(output_generated):
+ if len(output_generated) != 1:
+ return False
+ return True
+
+def check_if_in_input(input, output_generated):
+ input_arr = list(map(int, input))
+
+ if int(output_generated[0]) in input_arr:
+ return True
+ return False
+
+def check_output_index(input, output_generated):
+
+ input_arr = list(map(int, input))
+ min_index = input_arr.index(min(input_arr))
+ if int(output_generated[0]) not in input_arr:
+ return 5
+ index = input_arr.index(int(output_generated[0]))
+
+ return abs(index - min_index)
+
+
+# cur = []
+# res = []
+
+# def gen(k):
+# if k == 0:
+# random_val = random.randint(0, 1)
+# res.append((cur[:], random_val))
+# return
+
+# cur.append(0)
+# gen(k-1)
+# cur.pop()
+# cur.append(1)
+# gen(k-1)
+# cur.pop()
+
+# gen(10)
+
+# for input, output in res[:4]:
+# print(' '.join(map(str, input)), ':', output)
\ No newline at end of file
diff --git a/heuristics/regression.py b/heuristics/regression.py
new file mode 100644
index 0000000..f202138
--- /dev/null
+++ b/heuristics/regression.py
@@ -0,0 +1,15 @@
+import math
+
+def regression(_, output, output_generated):
+
+ score = -10000
+
+ if len(output_generated) != 1:
+ return -math.inf
+
+ if int(output_generated[0]) == int(output[0]):
+ score = 0
+
+ # print(score)
+
+ return score
\ No newline at end of file
diff --git a/raport1.ipynb b/raport1.ipynb
new file mode 100644
index 0000000..88b8dda
--- /dev/null
+++ b/raport1.ipynb
@@ -0,0 +1 @@
+{"cells":[{"cell_type":"markdown","metadata":{"id":"AGC6gUR81bVF"},"source":["# Raport Programowanie Genetyczne\n","Autorzy:\n","- Jan Karkowski\n","- Dawid Małecki"]},{"cell_type":"markdown","metadata":{"id":"KBc4GEl5H_w3"},"source":["## Zadania testowe dla systemu GP"]},{"cell_type":"markdown","metadata":{"id":"g0w2m59BH_w4"},"source":["# 1.1.A\n","Program powinien wygenerować na wyjściu (na dowolnej pozycji w danych wyjściowych) liczbę 1. Poza liczbą 1 może też zwrócić inne liczby."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7Pxe0dpjH_w5"},"outputs":[],"source":["\n","prog = '''\n"," var0 = 534;\n"," var1 = -219;\n"," if ((false != (-234 + 748))) {\n"," var0 = (((var0 - (var0 * -990)) < true) ^ (730 > false));\n"," output var1;\n"," output var0;\n"," }\n"," if ((((-790 // (-818 // input)) + 340) <= false)) {\n"," output var0;\n"," }\n"," var2 = -397;\n"," var1 = 237;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"G7W6fxpfH_w7"},"source":["# 1.1.B\n","Program powinien wygenerować na wyjściu (na dowolnej pozycji w danych wyjściowych) liczbę 789. Poza liczbą 789 może też zwrócić inne liczby."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7tzIV4hTH_w8"},"outputs":[],"source":["prog = '''\n"," var0 = input;\n"," var0 = input;\n"," var0 = 789;\n"," var1 = (-384 // 995);\n"," output var0;\n"," var2 = ((-341 + 273) - ((var1 - 183) - ((-341 + 273) * (525 // -691))));\n","'''"]},{"cell_type":"markdown","metadata":{"id":"niXv86hOH_w9"},"source":["# 1.1.C\n","Program powinien wygenerować na wyjściu (na dowolnej pozycji w danych wyjściowych) liczbę 31415. Poza liczbą 31415 może też zwrócić inne liczby."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"i4-ZMUkAH_w-"},"outputs":[],"source":["prog = '''\n"," var2 = 2086;\n"," var2 = 9372;\n"," var2 = 9869;\n"," var0 = (((input + 6058) + (((7039 // var2) - (-69 * input)) + ((((9869 // var2) - (-69 * input)) - (-69 * input)) // (var2 // 6058)))) - ((input // 9869) + (5405 * var1)));var0 = (((((7039 // var2) - (9978 * input)) + ((-895 + var2) + (1081 - var1))) + (((var1 - 1732) - (31 * -746)) + ((((input // 1350) + (9372 * var1)) + ((9978 // -69) // (var2 - 1732))) // (var2 // 6579)))) - ((((input // 1350) + (5405 * var1)) + ((9978 // -69) // (input + 6058))) * (((((7039 // var2) - (-69 * input)) + ((-895 + var2) + (1081 - var1))) + (((var1 - 1732) - (31 * -746)) + (((7039 // var2) - (-69 * input)) // (var2 // 6579)))) // ((input // -594) + (var1 + -966)))));\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"JwXJm1FNH_w-"},"source":["# 1.1.D\n","Program powinien wygenerować na pierwszej pozycji na wyjściu liczbę 1. Poza liczbą 1 może też zwrócić inne liczby."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"tY4oixWLH_w_"},"outputs":[],"source":["prog = '''\n"," var0 = input;\n"," var0 = (var0 // var0);\n"," output var0;\n"," output var0;\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"-OH4XYbQH_w_"},"source":["# 1.1.E\n","Program powinien wygenerować na pierwszej pozycji na wyjściu liczbę 789. Poza liczbą 789 może też zwrócić inne liczby."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"QIbikrULH_w_"},"outputs":[],"source":["prog = '''\n"," var0 = 789;\n"," output var0;\n"," output var0;\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"CFpokZ1TH_xA"},"source":["# 1.1.F\n","Program powinien wygenerować na wyjściu liczbę jako jedyną liczbę 1. Poza liczbą 1 NIE powinien nic więcej wygenerować."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"6tP4C0raH_xA"},"outputs":[],"source":["prog = '''\n"," var0 = 599;\n"," var0 = (not (false > false));\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"zGLEnh56H_xA"},"source":["# 1.2.A\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) ich sumę. Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [0,9]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"cKAjV66zH_xB"},"outputs":[],"source":["prog = '''\n"," var0 = -404;\n"," var1 = 210;\n"," var2 = (input + input);\n"," var0 = (var0 != (input * input));\n"," output var2;\n"," var0 = input;\n"," var2 = (var2 - var2);\n","'''"]},{"cell_type":"markdown","metadata":{"id":"ZUg-awTbH_xB"},"source":["# 1.2.B\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) ich sumę. Na wejściu mogą być tylko całkowite liczby w zakresie [-9,9]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"OxraCCRsH_xB"},"outputs":[],"source":["prog = '''\n"," var0 = input;\n"," var0 = (input + var0);\n"," var0 = var0;\n"," output var0;\n"," var0 = (var0 < (not input));\n"," var1 = (var0 == var0);\n","'''"]},{"cell_type":"markdown","metadata":{"id":"e6gdYAw2H_xB"},"source":["# 1.2.C\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) ich sumę. Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [-9999,9999]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"MHZJo6ZWH_xC"},"outputs":[],"source":["prog = '''\n"," var0 = -148;\n"," var1 = input;\n"," var1 = (input + var1);\n"," output var1;\n"," var2 = (var1 == var2);\n","'''"]},{"cell_type":"markdown","metadata":{"id":"ZWkK9lrTH_xC"},"source":["# 1.2.D\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) ich różnicę. Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [-9999,9999]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"AeDkp5e3H_xC"},"outputs":[],"source":["prog = '''\n"," var3 = 406;\n"," var0 = input;\n"," var3 = input;\n"," var3 = (var0 - var3);\n"," output var3;\n"," var1 = input;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"Hn6LDEziH_xC"},"source":["# 1.2.E\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) ich iloczyn. Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [-9999,9999]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"_FxOk8z2H_xC"},"outputs":[],"source":["prog = '''\n"," var0 = input;\n"," var1 = -171;\n"," var0 = (input * var0);\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"jIOsuoQ1H_xD"},"source":["# 1.3.A\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) większą z nich. Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [0,9]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"aA-zajy0H_xD"},"outputs":[],"source":["prog = '''\n"," var1 = input;\n"," if ((var0 > var1)) {\n"," if ((input < var1)) { }\n"," }\n"," var0 = input;\n"," if ((var0 > var1)) {\n"," var1 = var0;\n"," }\n"," output var1;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"9bonEySkH_xD"},"source":["# 1.3.B\n","Program powinien odczytać dwie pierwsze liczy z wejścia i zwrócić na wyjściu (jedynie) większą z nich. Na wejściu mogą być tylko całkowite liczby w zakresie [-9999,9999]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"j4THnkOWH_xH"},"outputs":[],"source":["prog = '''\n"," var0 = input;\n"," var1 = input;\n"," if ((input > var1)) {\n"," if ((var1 < var0)) {\n"," if ((var1 < var0)) {\n"," if ((var1 < var0)) {\n"," var1 = var0;\n"," }\n"," }\n"," }\n"," }\n"," if ((var1 < var0)) {\n"," var1 = var0;\n"," }\n"," if ((input > var1)) {\n"," var0 = input;\n"," }\n"," output var1;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"uQR06S4rH_xH"},"source":["# 1.4.A\n","Program powinien odczytać dziesięć pierwszych liczy z wejścia i zwrócić na wyjściu (jedynie) ich średnią arytmetyczną (zaokrągloną do pełnej liczby całkowitej). Na wejściu mogą być tylko całkowite liczby w zakresie [-99,99]"]},{"cell_type":"markdown","metadata":{"id":"WGd3kU-9H_xI"},"source":["# 1.4.B\n","Program powinien odczytać na początek z wejścia pierwszą liczbę (ma być to wartość nieujemna) a następnie tyle liczb (całkowitych) jaka jest wartość pierwszej odczytanej liczby i zwrócić na wyjściu (jedynie) ich średnią arytmetyczną zaokrągloną do pełnej liczby całkowitej (do średniej nie jest wliczana pierwsza odczytana liczba, która mówi z ilu liczb chcemy obliczyć średnią). Na wejściu mogą być tylko całkowite liczby w zakresie [-99,99], pierwsza liczba może być tylko w zakresie [0,99]."]}],"metadata":{"colab":{"provenance":[]},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.11"}},"nbformat":4,"nbformat_minor":0}
diff --git a/raport2.ipynb b/raport2.ipynb
new file mode 100644
index 0000000..e38ea9a
--- /dev/null
+++ b/raport2.ipynb
@@ -0,0 +1 @@
+{"cells":[{"cell_type":"markdown","metadata":{"id":"KYlUOwxa0oc5"},"source":["# Raport Programowanie Genetyczne\n","Autorzy:\n","- Jan Karkowski\n","- Dawid Małecki"]},{"cell_type":"markdown","metadata":{"id":"T5n-Cj-a0oc9"},"source":["## Jeden wybrany problem z BenchmarkSuiteGECCO2015 z zakresu 1-5 (strona 9)\n","2. Small or Large (Q 4.6.3)
\n","Na wejściu mogą być tylko całkowite liczby dodatnie w zakresie [0,3000]
\n","Program powinien odczytać pierwszą liczę z wejścia i zwrócić na wyjściu (jedynie):\n"," - 0 jeśli liczba jest minejsza od 1000\n"," - 1 jeśli liczba jest wieksza lub równa 1000 i mniejsza od 2000\n"," - 2 jesli liczba jest większa lub równa 2000"]},{"cell_type":"markdown","metadata":{"id":"yO2VBMQg0oc-"},"source":["#### Dane wejściowe"]},{"cell_type":"code","execution_count":4,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":3,"status":"ok","timestamp":1706827615398,"user":{"displayName":"Jan Karkowski","userId":"02048428057945241222"},"user_tz":-60},"id":"TpNMOtMX0oc_","outputId":"570e2787-8e4d-4357-980a-f83fe1bfb7b4"},"outputs":[{"name":"stdout","output_type":"stream","text":["1474 : 1\n","861 : 0\n","2006 : 2\n","2079 : 2\n","796 : 0\n","69 : 0\n","2614 : 2\n","2178 : 2\n","1477 : 1\n","1571 : 1\n","2785 : 2\n","68 : 0\n","1766 : 1\n","2759 : 2\n","825 : 0\n","1638 : 1\n","1756 : 1\n","1652 : 1\n","1358 : 1\n","1615 : 1\n"]}],"source":["import random\n","for i in range(20):\n"," x = random.randint(0, 3000)\n"," if x < 1000:\n"," y = 0\n"," elif x > 2000:\n"," y = 2\n"," else:\n"," y = 1\n","\n"," print(x, \":\", y)"]},{"cell_type":"markdown","metadata":{"id":"n2HjqPH10odB"},"source":["#### Funkcja przystosowania"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"H-ATveSS0odB"},"outputs":[],"source":["import math\n","\n","def h_2_2(input, output, output_generated, best_fitness, len_input):\n"," if len(output_generated) != 1:\n"," return -math.inf\n","\n"," score = -10000\n"," i = int(input[0])\n"," o = int(output[0])\n"," og = int(output_generated[0])\n","\n"," isFirstPart = first_part(i, og)\n"," if isFirstPart:\n"," score += 9000\n","\n"," if best_fitness == None:\n"," return score\n","\n"," if len_input == None:\n"," return score\n","\n","\n"," isSecondPart = False\n"," isThirdPart = False\n","\n"," if isFirstPart or best_fitness >= -1000*len_input:\n"," isSecondPart = second_part(i, og)\n"," if isSecondPart:\n"," score += 900\n"," if isSecondPart or best_fitness >= -100*len_input:\n"," isThirdPart = third_part(i, og)\n"," if isThirdPart:\n"," score += 90\n"," if isThirdPart or best_fitness >= -10*len_input:\n"," if full(o, og):\n"," score = 0\n","\n"," return score\n","\n","def full(original_output, output):\n"," if original_output == output:\n"," return True\n"," return False\n","\n","def first_part(input, output):\n"," if input < 1000:\n"," if output == 0 :\n"," return True\n"," else:\n"," return False\n"," else:\n"," return True\n","\n","def second_part(input, output):\n"," if input >= 2000:\n"," if output == 2:\n"," return True\n"," else:\n"," return False\n"," else:\n"," return True\n","\n","def third_part(input, output):\n"," if input >= 1000 and input < 2000:\n"," if output == 1:\n"," return True\n"," else:\n"," return False\n"," else:\n"," return True"]},{"cell_type":"markdown","metadata":{"id":"kzwrvCaR0odC"},"source":["### Opis\n","1. Początkowe warunki sprawdzania:\n","- czy program zwraca jakąkolwiek wartość (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","- czy w programie występują jakie błędy np.: dzielenie przez 0 (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","- czy program zwraca tylko jedną wartość\n","2. Kolejne warunki:\n","- (input < 1000) -> 0\n","- (input >= 2000) -> 2\n","- (1000 < input >= 2000) -> 1\n","- wszystkie warunki naraz\n","3. Funkcja przystosowania działa stopniowo, przestrzegając określonych kroków:\n","- początkowo sprawdzany jest tylko pierwszy warunek, jeśli warunek jest spełniony sprawdzamy drugi warunek itd.\n","- dodatkowo funkcja działa stopniowo to znaczy: jeśli w populacji jest chociaż jeden program który spełnia pierwszy warunek to przy każdej kolejnej generacji jest też sprawdzany drugi warunek niezależnie od punktu wyżej itd. Dzięki temu sprawdzanie następnych warunków dla kolejnych programów następuje skokowo, czyli nie zawsze są sprawdzane wszystkie warunki.\n","\n"]},{"cell_type":"markdown","metadata":{},"source":["### Wynik\n","Mimo wielu prób, nie udało się wygenerować programu, który spełniałby ten problem, co może wynikać z trudności w dostosowaniu programu genetycznego do tych ściśle określonych kryteriów.\n","Proces rozpoczęliśmy od prostych funkcji dostosowania, jednakże nawet zastosowanie bardziej złożonych metod, takich jak opisana funkcja przystosowania \"skokowa\", nie przyniosło oczekiwanych rezultatów."]},{"cell_type":"markdown","metadata":{"id":"e3Kx3PrK0odD"},"source":["## Jeden wybrany problem z BenchmarkSuiteGECCO2015 ze zbioru {6, 15, 17, 18, 21}\n","\n","21. Negative To Zero (Q 9.6.8)\n","\n","Na wejściu dany wektor liczb całkowitych.
\n","Program zwraca wektor, w którym wszystkie wartości ujemne zostały zastąpione przez 0\n"]},{"cell_type":"markdown","metadata":{"id":"qS3r0bPK0odD"},"source":["#### Dane wejściowe"]},{"cell_type":"code","execution_count":5,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":507,"status":"ok","timestamp":1706827620616,"user":{"displayName":"Jan Karkowski","userId":"02048428057945241222"},"user_tz":-60},"id":"VcUGVXp80odE","outputId":"94187df3-5f1a-498d-ab40-5118047ca4aa"},"outputs":[{"name":"stdout","output_type":"stream","text":["973 765 439 -719 -517 406 -317 335 : 973 765 439 0 0 406 0 335\n","4 35 -887 -463 : 4 35 0 0\n","133 751 -507 205 : 133 751 0 205\n","-540 239 : 0 239\n","299 -314 : 299 0\n","700 57 860 -783 -789 -792 -987 -784 -583 : 700 57 860 0 0 0 0 0 0\n","-397 -425 -61 -516 : 0 0 0 0\n","37 : 37\n","-402 995 669 399 -334 976 877 810 637 512 : 0 995 669 399 0 976 877 810 637 512\n","-161 880 910 -629 987 -386 807 415 958 211 : 0 880 910 0 987 0 807 415 958 211\n","-67 -490 903 : 0 0 903\n","36 723 -357 -216 753 888 495 -691 : 36 723 0 0 753 888 495 0\n","-802 790 -322 179 : 0 790 0 179\n","941 : 941\n","862 389 -752 958 -606 577 174 -603 : 862 389 0 958 0 577 174 0\n","-776 -933 -18 381 319 : 0 0 0 381 319\n","746 -428 347 501 -755 362 868 842 918 876 : 746 0 347 501 0 362 868 842 918 876\n","-758 -794 -151 529 335 -126 : 0 0 0 529 335 0\n","348 367 128 -227 -333 33 : 348 367 128 0 0 33\n","201 -410 -608 253 597 147 568 80 -990 747 : 201 0 0 253 597 147 568 80 0 747\n"]}],"source":["import random\n","\n","for i in range(0, 20):\n"," t1 = []\n"," t2 = []\n"," n = random.randint(1, 10)\n"," for j in range(0, n):\n"," x = random.randint(-1000, 1000)\n"," t1.append(x)\n"," if x < 0:\n"," t2.append(0)\n"," else:\n"," t2.append(x)\n"," print(' '.join(map(str, t1)), ':', ' '.join(map(str, t2)))"]},{"cell_type":"markdown","metadata":{"id":"KzJ6yhpS0odE"},"source":["#### Funkcja przystosowania"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"YfVbMLBX0odE"},"outputs":[],"source":["def h_2_21(input, output, output_generated, best_fitness, len_input):\n"," score = -10000\n","\n"," isLength = check_length(input, output_generated)\n"," if isLength:\n"," score += 9000\n","\n"," if best_fitness == None:\n"," return score\n","\n"," if len_input == None:\n"," return score\n","\n","\n"," isOutputSameAsInput = False\n"," isCorrectOutput = False\n","\n"," if isLength or best_fitness >= -1000*len_input:\n"," isOutputSameAsInput = check_output_same_as_input(input, output_generated)\n"," if isOutputSameAsInput:\n"," score += 900\n"," if isOutputSameAsInput or best_fitness >= -100*len_input:\n"," isCorrectOutput = check_correct_output(output, output_generated)\n"," if isCorrectOutput:\n"," score = 0\n"," return score\n","\n","\n","def check_length(input, output_generated):\n"," if len(input) != len(output_generated):\n"," return False\n"," return True\n","\n","def check_output_same_as_input(input, output_generated):\n"," for i in range(len(input)):\n"," if input[i] != output_generated[i]:\n"," return False\n"," return True\n","\n","\n","def check_correct_output(output, output_generated):\n"," for i in range(len(output)):\n"," if output[i] != output_generated[i]:\n"," return False\n","\n"," return True"]},{"cell_type":"markdown","metadata":{"id":"raQmCVMw0odF"},"source":["### Opis\n","1. Początkowe warunki sprawdzania:\n","- czy program zwraca jakąkolwiek wartość (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","- czy w programie występują jakie błędy np.: dzielenie przez 0 (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","2. Kolejne warunki:\n","- czy długość tablicy input jest równa długości tablicy output_generated\n","- czy tablica input == tablica output_generated\n","- czy w tablicy output_generated wartości ujemne są zastąpione '0'\n","3. Funkcja przystosowania działa stopniowo, przestrzegając określonych kroków:\n","- początkowo sprawdzany jest tylko pierwszy warunek, jeśli warunek jest spełniony sprawdzamy drugi warunek itd.\n","- dodatkowo funkcja działa stopniowo to znaczy: jeśli w populacji jest chociaż jeden program który spełnia pierwszy warunek to przy każdej kolejnej generacji jest też sprawdzany drugi warunek niezależnie od punktu wyżej itd. Dzięki temu sprawdzanie następnych warunków dla kolejnych programów następuje skokowo, czyli nie zawsze są sprawdzane wszystkie warunki.\n","\n","\n"]},{"cell_type":"markdown","metadata":{},"source":["### Wynik\n","Mimo wielu prób, nie udało się wygenerować programu, który spełniałby ten problem, co może wynikać z trudności w dostosowaniu programu genetycznego do tych ściśle określonych kryteriów.\n","Proces rozpoczęliśmy od prostych funkcji dostosowania, jednakże nawet zastosowanie bardziej złożonych metod, takich jak opisana funkcja przystosowania \"skokowa\", nie przyniosło oczekiwanych rezultatów."]},{"cell_type":"markdown","metadata":{"id":"-ywQPCDz0odF"},"source":["## Jeden wybrany problem z BenchmarkSuiteGECCO2015 ze zbioru {26, 27, 28,}\n","\n","28. Smallest\n","\n","Na wejściu dany wektor czterech liczb całkowitych.
\n","Program zwraca najmniejszą liczbę."]},{"cell_type":"markdown","metadata":{"id":"_mxm5ez80odF"},"source":["#### Dane wejściowe"]},{"cell_type":"code","execution_count":6,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":403,"status":"ok","timestamp":1706827625274,"user":{"displayName":"Jan Karkowski","userId":"02048428057945241222"},"user_tz":-60},"id":"9CxUoBSO0odF","outputId":"2039705f-f0ee-46f9-b080-1a2d32a6a316"},"outputs":[{"name":"stdout","output_type":"stream","text":["71 953 611 247 : 71\n","-44 853 669 6 : -44\n","564 569 599 -55 : -55\n","16 741 516 591 : 16\n","23 771 251 235 : 23\n","-24 815 974 689 : -24\n","182 409 435 890 : 182\n","858 707 170 -75 : -75\n","264 414 -69 283 : -69\n","231 217 387 255 : 217\n","142 939 895 -15 : -15\n","842 183 534 834 : 183\n","418 290 940 723 : 290\n","640 580 312 646 : 312\n","242 537 -70 581 : -70\n","143 584 55 294 : 55\n","513 732 355 994 : 355\n","280 974 854 -74 : -74\n","516 387 972 -25 : -25\n","996 638 556 275 : 275\n"]}],"source":["import random\n","for i in range(20):\n"," t1 = []\n"," for j in range(4):\n"," x = random.randint(-100, 1000)\n"," t1.append(x)\n","\n"," print(' '.join(map(str, t1)), ':', min(t1))"]},{"cell_type":"markdown","metadata":{"id":"PzhSDrwD0odF"},"source":["#### Funkcja przystosowania"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"v0ED6k060odF"},"outputs":[],"source":["def h_2_28(input, output, output_generated, best_fitness, len_input):\n"," score = -10000\n"," isLength = check_output_length(output_generated)\n","\n"," if isLength:\n"," score += 9000\n","\n"," if best_fitness == None:\n"," return score\n","\n"," if len_input == None:\n"," return score\n","\n"," isInInput = False\n"," if isLength or best_fitness >= -1000*len_input:\n"," isInInput = check_if_in_input(input, output_generated)\n"," if isInInput:\n"," score += 900\n"," if isInInput or best_fitness >= -100*len_input:\n"," score = check_output_index(input, output_generated) * 10\n","\n"," return score\n","\n","\n","def check_output_length(output_generated):\n"," if len(output_generated) != 1:\n"," return False\n"," return True\n","\n","def check_if_in_input(input, output_generated):\n"," input_arr = list(map(int, input.split(' ')))\n","\n"," if int(output_generated[0]) in input_arr:\n"," return True\n"," return False\n","\n","def check_output_index(input, output_generated):\n"," input_arr = list(map(int, input.split(' ')))\n"," min_index = input_arr.index(min(input_arr))\n"," index = input_arr.index(int(output_generated[0]))\n","\n"," return abs(index - min_index)"]},{"cell_type":"markdown","metadata":{"id":"qfuR-pvH0odG"},"source":["### Opis\n","1. Początkowe warunki sprawdzania:\n","- czy program zwraca jakąkolwiek wartość (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","- czy w programie występują jakie błędy np.: dzielenie przez 0 (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","2. Kolejne warunki:\n","- czy długość tablicy output_generated jest równa 1\n","- czy wartość w tablicy output_generated pochodzi z tablicy input\n","- czy wartość w tablicy output_generated jest najmniejszą wartością, jeśli nie sprawdzamy o ile się pomylił względem pozostałych liczb z tablicy input\n","- wszystkie warunki naraz\n","3. Funkcja przystosowania działa stopniowo, przestrzegając określonych kroków:\n","- początkowo sprawdzany jest tylko pierwszy warunek, jeśli warunek jest spełniony sprawdzamy drugi warunek itd.\n","- dodatkowo funkcja działa stopniowo to znaczy: jeśli w populacji jest chociaż jeden program który spełnia pierwszy warunek to przy każdej kolejnej generacji jest też sprawdzany drugi warunek niezależnie od punktu wyżej itd. Dzięki temu sprawdzanie następnych warunków dla kolejnych programów następuje skokowo, czyli nie zawsze są sprawdzane wszystkie warunki.\n"]},{"cell_type":"markdown","metadata":{},"source":["### Wynik\n","Mimo wielu prób, nie udało się wygenerować programu, który spełniałby ten problem, co może wynikać z trudności w dostosowaniu programu genetycznego do tych ściśle określonych kryteriów.\n","Proces rozpoczęliśmy od prostych funkcji dostosowania, jednakże nawet zastosowanie bardziej złożonych metod, takich jak opisana funkcja przystosowania \"skokowa\", nie przyniosło oczekiwanych rezultatów."]},{"cell_type":"markdown","metadata":{"id":"HjtYA6j90odG"},"source":["## Regresja symboliczna dla funkcji boolowskiej\n","Dana jest pewna funkcja boolowska (ang. boolean function) postaci:\n","f : {0,1}k → {0,1}\n","Czyli funkcja, której argumentem jest k zmiennych logicznych, a wyjściem jedna liczba logiczna (0/1)\n","\n","Sprawdzić czy podczas procesu ewolucji GP uda się wygenerować program odtwarzający działanie tej funkcji boolowskiej.\n","Jako dane uczące (fitness cases) należy podać odwzorowanie wszystkich możliwych wektorów wejściowe (będzie ich 2k) na wartość wyjściową (0/1)\n","\n","Funkcje boolowskie dla k=1:\n","\n","D0\n","NOT(D0)\n","\n","Przykładowe funkcje boolowskie dla k=2:\n","\n","D0 AND D1\n","D0 OR D1\n","D0 XOR D1\n","\n","itd.\n","\n","Proszę sprawdzić czy Państwa system jest w stanie wygenerować programy odtwarzające funkcje boolowskie dla k=1, k=2, k=3,...., k=10\n","\n","Ponieważ funkcję boolowską można reprezentować jako tabelę prawdy (dla danego k, tabela będzie miała k kolumn reprezentujących poszczególne dane wejściowe D0,D1,...,Dk; jedną kolumnę reprezentującą wynik funkcji 0/1; oraz 2k wierszy reprezentujących poszczególne kombinacje wartości D0,...,Dk), można wygenerować sobie losowo ta tabelę (tzn. kolumnę z wynikami funkcji) i traktować ją jako fitness cases."]},{"cell_type":"markdown","metadata":{"id":"OlLO3-dI0odG"},"source":["#### Dane wejściowe"]},{"cell_type":"code","execution_count":7,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"elapsed":482,"status":"ok","timestamp":1706827634660,"user":{"displayName":"Jan Karkowski","userId":"02048428057945241222"},"user_tz":-60},"id":"yTllmfng0odG","outputId":"cfb33a12-5359-4fdf-a8c0-d7051a564558"},"outputs":[{"name":"stdout","output_type":"stream","text":["0 0 0 : 0\n","0 0 1 : 1\n","0 1 0 : 0\n","0 1 1 : 1\n","1 0 0 : 0\n","1 0 1 : 0\n","1 1 0 : 1\n","1 1 1 : 1\n"]}],"source":["import random\n","\n","cur = []\n","res = []\n","\n","def gen(k):\n"," if k == 0:\n"," random_val = random.randint(0, 1)\n"," res.append((cur[:], random_val))\n"," return\n","\n"," cur.append(0)\n"," gen(k-1)\n"," cur.pop()\n"," cur.append(1)\n"," gen(k-1)\n"," cur.pop()\n","\n","gen(3)\n","\n","for input, output in res:\n"," print(' '.join(map(str, input)), ':', output)"]},{"cell_type":"markdown","metadata":{"id":"JxfnKMcS0odH"},"source":["#### Funkcja przystosowania"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"XUCy2j6c0odH"},"outputs":[],"source":["# k = 1\n","data = '''\n","0 : 1\n","1 : 0\n","'''\n","\n","data = '''\n"," var2 = 1;\n"," var0 = (((not false) > input) and ((not false) == true));\n"," if ((var1 < -663)) {\n"," var0 = -169;\n"," }\n"," output var0;\n","'''\n","\n","# k = 2\n","data = '''\n","0 0 : 0\n","0 1 : 0\n","1 0 : 1\n","1 1 : 1\n","'''\n","prog = '''\n"," var0 = input;\n"," var2 = input;\n"," var1 = input;\n"," if ((var0 > (var2 - var2))) {\n"," var3 = input;\n"," }if ((not (var0 < -805))) {\n","\n"," }\n"," output var0;\n","'''"]},{"cell_type":"markdown","metadata":{"id":"vUiqk0pP0odH"},"source":["### Opis\n","1. Początkowe warunki sprawdzania:\n","- czy program zwraca jakąkolwiek wartość (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","- czy w programie występują jakie błędy np.: dzielenie przez 0 (ten warunek jest sprawdzany w innym miejscu, przed wywołaniem tej funkcji)\n","2. Kolejne warunki:\n","- czy długość tablicy output_generated jest równa 1\n","- czy wartość w tablicy output_generated jest równa oczekiwanej wartości output\n","\n","\n"]},{"cell_type":"markdown","metadata":{},"source":["### Wynik\n","Mimo wielu prób, nie udało się wygenerować programu, który spełniałby ten problem dla dowolnego k.\n","Udało się znaleźć dopasowanie dla k = 1 oraz k = 2"]}],"metadata":{"colab":{"provenance":[]},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.11"}},"nbformat":4,"nbformat_minor":0}
diff --git a/state.py b/state.py
index e586c5a..29a8d39 100644
--- a/state.py
+++ b/state.py
@@ -8,6 +8,10 @@ def __init__(self, config):
self.stack = []
self.fitness = []
+ def seed(self, seed, variables):
+ self.init_new_indiv_state()
+ self.stack[self.current_indiv_index] = seed
+ self.variables[self.current_indiv_index] = variables
def init_new_indiv_state(self):
if self.current_indiv_index == None:
diff --git a/treeFactory.py b/treeFactory.py
index 4234df3..c23898c 100644
--- a/treeFactory.py
+++ b/treeFactory.py
@@ -145,10 +145,14 @@ def _generate_initial_variables(self):
def generate_population(self):
- for i in range(self.config.population):
+ for i in range(self.config.population - 1):
self.state.init_new_indiv_state()
self._generate_initial_variables()
self._generate_block()
fitness = self.fitness.fitness_function(self.state.get_indiv_stack(i))
self.state.set_cur_indiv_fitness(fitness)
+
+ self.state.seed(['=', 'var0', '1','=', 'var1', 'input', 'if', '<', 'var1', '1000', '{', '=', 'var0', '0', '}', 'output','var0'], ['var0', 'var1'])
+ fitness = self.fitness.fitness_function(self.state.get_indiv_stack(self.state.current_indiv_index))
+ self.state.set_cur_indiv_fitness(fitness)