From d7c2e446a38c0cdf1d57305817ddad45197693c5 Mon Sep 17 00:00:00 2001 From: Kacper Date: Fri, 10 Jun 2022 02:16:56 +0200 Subject: [PATCH] tsp v3.2 --- decision_tree/tree_as_txt.txt | 70 ++++++++++----------- decision_tree/tree_model | Bin 5511 -> 5511 bytes genetic_algorithm/TSP.py | 2 +- last_map.nparr | Bin 0 -> 896 bytes path_search_algorthms/a_star_controller.py | 26 ++++++++ 5 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 last_map.nparr create mode 100644 path_search_algorthms/a_star_controller.py diff --git a/decision_tree/tree_as_txt.txt b/decision_tree/tree_as_txt.txt index aaa701a..9b5c043 100644 --- a/decision_tree/tree_as_txt.txt +++ b/decision_tree/tree_as_txt.txt @@ -16,28 +16,6 @@ | | | | | |--- feature_1 <= 2.50 | | | | | | |--- feature_0 <= 2.50 | | | | | | | |--- feature_1 <= 1.50 -| | | | | | | | |--- feature_2 <= 2.50 -| | | | | | | | | |--- class: 1 -| | | | | | | | |--- feature_2 > 2.50 -| | | | | | | | | |--- feature_4 <= 2.00 -| | | | | | | | | | |--- class: 1 -| | | | | | | | | |--- feature_4 > 2.00 -| | | | | | | | | | |--- class: 0 -| | | | | | | |--- feature_1 > 1.50 -| | | | | | | | |--- class: 0 -| | | | | | |--- feature_0 > 2.50 -| | | | | | | |--- feature_4 <= 2.50 -| | | | | | | | |--- class: 1 -| | | | | | | |--- feature_4 > 2.50 -| | | | | | | | |--- feature_2 <= 2.50 -| | | | | | | | | |--- class: 1 -| | | | | | | | |--- feature_2 > 2.50 -| | | | | | | | | |--- class: 0 -| | | | | |--- feature_1 > 2.50 -| | | | | | |--- feature_0 <= 3.50 -| | | | | | | |--- class: 0 -| | | | | | |--- feature_0 > 3.50 -| | | | | | | |--- feature_1 <= 3.50 | | | | | | | | |--- feature_4 <= 2.50 | | | | | | | | | |--- class: 1 | | | | | | | | |--- feature_4 > 2.50 @@ -45,8 +23,30 @@ | | | | | | | | | | |--- class: 1 | | | | | | | | | |--- feature_2 > 2.00 | | | | | | | | | | |--- class: 0 -| | | | | | | |--- feature_1 > 3.50 +| | | | | | | |--- feature_1 > 1.50 | | | | | | | | |--- class: 0 +| | | | | | |--- feature_0 > 2.50 +| | | | | | | |--- feature_2 <= 2.50 +| | | | | | | | |--- class: 1 +| | | | | | | |--- feature_2 > 2.50 +| | | | | | | | |--- feature_4 <= 2.50 +| | | | | | | | | |--- class: 1 +| | | | | | | | |--- feature_4 > 2.50 +| | | | | | | | | |--- class: 0 +| | | | | |--- feature_1 > 2.50 +| | | | | | |--- feature_1 <= 3.50 +| | | | | | | |--- feature_0 <= 3.50 +| | | | | | | | |--- class: 0 +| | | | | | | |--- feature_0 > 3.50 +| | | | | | | | |--- feature_4 <= 2.50 +| | | | | | | | | |--- class: 1 +| | | | | | | | |--- feature_4 > 2.50 +| | | | | | | | | |--- feature_2 <= 2.00 +| | | | | | | | | | |--- class: 1 +| | | | | | | | | |--- feature_2 > 2.00 +| | | | | | | | | | |--- class: 0 +| | | | | | |--- feature_1 > 3.50 +| | | | | | | |--- class: 0 | | | | |--- feature_3 > 4.50 | | | | | |--- class: 0 | |--- feature_4 > 3.50 @@ -59,13 +59,13 @@ | | | | | | |--- class: 1 | | | | |--- feature_3 > 3.50 | | | | | |--- feature_1 <= 2.50 -| | | | | | |--- feature_0 <= 2.50 -| | | | | | | |--- class: 0 -| | | | | | |--- feature_0 > 2.50 -| | | | | | | |--- feature_3 <= 4.50 -| | | | | | | | |--- class: 1 -| | | | | | | |--- feature_3 > 4.50 +| | | | | | |--- feature_3 <= 4.50 +| | | | | | | |--- feature_0 <= 2.50 | | | | | | | | |--- class: 0 +| | | | | | | |--- feature_0 > 2.50 +| | | | | | | | |--- class: 1 +| | | | | | |--- feature_3 > 4.50 +| | | | | | | |--- class: 0 | | | | | |--- feature_1 > 2.50 | | | | | | |--- class: 0 | | | |--- feature_4 > 4.50 @@ -76,13 +76,13 @@ | |--- feature_4 <= 1.50 | | |--- feature_1 <= 1.50 | | | |--- feature_2 <= 4.50 -| | | | |--- feature_0 <= 1.50 -| | | | | |--- class: 0 -| | | | |--- feature_0 > 1.50 -| | | | | |--- feature_3 <= 4.50 -| | | | | | |--- class: 1 -| | | | | |--- feature_3 > 4.50 +| | | | |--- feature_3 <= 4.50 +| | | | | |--- feature_0 <= 1.50 | | | | | | |--- class: 0 +| | | | | |--- feature_0 > 1.50 +| | | | | | |--- class: 1 +| | | | |--- feature_3 > 4.50 +| | | | | |--- class: 0 | | | |--- feature_2 > 4.50 | | | | |--- class: 0 | | |--- feature_1 > 1.50 diff --git a/decision_tree/tree_model b/decision_tree/tree_model index bf4e0f6daad5d9a9e4a959444ffa735d29956628..c9ec1be792e54f0351a46d1c12ee958766401369 100644 GIT binary patch delta 279 zcmZqIZr9$R$UfPSD}hsx0Rn_3&*C~hIgmqvk!f-fM?NFVs*L5*9n;T3-k5xM$CWVwj49Ih1dKA`avHu%8^r>oD1p&th|? zz-gw*F2Vv#N)D6f35iXv5%OTPp1f3e{^S@D&dISN96&5EIaP#z@*g3A$!~->C-;iv UPv#NjoNOz?KKTz&ji_i506gkE`Tzg` delta 286 zcmZqIZr9$R$j-<#S&2QLk!5nci0I_y?5BXNB945Z=p&B#oYD+XFu99UeR3eHh9F!7 zEMe^+Gr5XWe)2_5iOq^!4vhSqFb!Z@X>$ShNk$1B6hRn=#bNSCeuv4Hd;*NRlZ|*) zC-?KN+FZzIz^GsjQ-VVOu-_rq`Z{pOJ^RTw1uQ0Katbh7OrFIr4>DzQrod??E^7yv zhRJ%uVv|dR0vMGhFBP6Y`Hzsm$vz^SlVgE&t_VAn%|7{!5a;Axk^IRqKsk{3 KA0RC%S_A+JlRjwx diff --git a/genetic_algorithm/TSP.py b/genetic_algorithm/TSP.py index 12553e0..e1f851e 100644 --- a/genetic_algorithm/TSP.py +++ b/genetic_algorithm/TSP.py @@ -4,7 +4,7 @@ from decision_tree import decisionTree # klasa tworząca miasta czy też śmietniki class City: - def __init__(self, x, y, dist): + def __init__(self, x, y): self.x = x self.y = y # self.dist = distance diff --git a/last_map.nparr b/last_map.nparr new file mode 100644 index 0000000000000000000000000000000000000000..c7394756c0d409040b7c20f2f772aef006ad9e13 GIT binary patch literal 896 zcmbVGu?oU46l@*+ifmEnQV|Dnc2is&oFv$Yg4mLZi})4(uzkqU=V7q=AiZ~&yGtL- z^`a|Rqa@oP=*@H_!{WE