changed some data regarding decision_tree's; changed map a bit

This commit is contained in:
JakubR 2021-05-24 01:05:00 +02:00
parent f6ff6e548c
commit 32c50f27fc
6 changed files with 12053 additions and 20053 deletions

View File

@ -75,7 +75,7 @@ class DecisionTree:
if __name__ == "__main__":
# generate_data("training_set.txt", 20000)
# generate_data("training_set.txt", 12000)
decision_tree = DecisionTree()
decision_tree.build("training_set.txt", 15)
decision_tree.test()

View File

@ -9,28 +9,28 @@ class Wire(Enum):
class TypeHash(Enum):
TIME = 90, "time"
CHAINED = 12, "chained"
CHAINED = 45, "chained"
STANDARD = 0, "standard"
class DangerClassHash(Enum):
BIG_BANG = 64, "big bang"
WEAPON_OF_MASS_DESTRUCTION = 32, "weapon of mass destruction"
RADIOACTIVE = 16, "radioactive"
CASUAL_DEVASTATOR = 8, "casual devastator"
LITTLE_BOY = 4, "little boy"
WEAPON_OF_MASS_DESTRUCTION = 48, "weapon of mass destruction"
RADIOACTIVE = 36, "radioactive"
CASUAL_DEVASTATOR = 20, "casual devastator"
ALMOST_PIERCES_THROUGH_PAPER = 10, "almost pierces through paper"
CHERRY_BOMB = 0, "cherry bomb"
class SeriesHash(Enum):
TCH_2990TONER = 128, "TCH_2990toner"
TCH_2990INKJET = 64, "TCH_2990inkjet"
TVY_2400H = 48, "TVY_2400h"
SWX_5000 = 32, "SWX_5000"
SWX_4000 = 16, "SWX_4000"
WORKHORSE_3200 = 8, "WORKHORSE_3200"
FX_500 = 4, "FX_500"
TVY_2400 = 0, "TVY_2400"
TCH_2990TONER = 128, "TCH 2990toner"
TCH_2990INKJET = 110, "TCH 2990inkjet"
TVY_2400H = 100, "TVY 2400h"
SWX_5000 = 80, "SWX 5000"
SWX_4000 = 50, "SWX 4000"
WORKHORSE_3200 = 30, "WORKHORSE 3200"
FX_500 = 15, "FX 500"
TVY_2400 = 0, "TVY 2400"
class IndicatorHash(Enum):
@ -42,21 +42,21 @@ class IndicatorHash(Enum):
class SpecificityHash(Enum):
ANTI_AIRCRAFT = 55, "anti_aircraft"
ANTI_PERSONNEL = 43, "anti_personnel"
DEPTH_MINE = 37, "depth_mine"
ANTI_TANK = 26, "anti_tank"
PROXIMITY_MINE = 18, "proximity_mine"
PRESSURE_MINE = 9, "pressure_mine"
FRAGMENTATION_MINE = 0, "fragmentation_mine"
ANTI_AIRCRAFT = 55, "anti aircraft"
ANTI_PERSONNEL = 43, "anti personnel"
DEPTH_MINE = 37, "depth mine"
ANTI_TANK = 26, "anti tank"
PROXIMITY_MINE = 18, "proximity mine"
PRESSURE_MINE = 9, "pressure mine"
FRAGMENTATION_MINE = 0, "fragmentation mine"
class WeightHash(Enum):
FAT_MAN = 32, "fat_man"
EXTRA_LARGE = 24, "extra_large"
TOTAL_AVERAGE = 16, "total_average"
SLIM_FIT = 8, "slim_fit"
BREAD_CRUMB = 0, "bread_crumb"
GINORMOUS = 32, "ginormous"
EXTRA_LARGE = 24, "extra large"
TOTAL_AVERAGE = 16, "total average"
SLIM_FIT = 8, "slim fit"
BREAD_CRUMB = 0, "bread crumb"
MAX_VALUE = max([elem.value[0] for elem in TypeHash]) \
@ -68,9 +68,9 @@ MAX_VALUE = max([elem.value[0] for elem in TypeHash]) \
def _get_wire_color(hash_sum):
if hash_sum < 0.4 * MAX_VALUE:
if hash_sum < 0.43 * MAX_VALUE:
return Wire.BLUE
elif hash_sum <= 0.6 * MAX_VALUE:
elif hash_sum <= 0.56 * MAX_VALUE:
return Wire.GREEN
else:
return Wire.RED

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
"mine": null
},
"0,1": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"0,2": {
@ -30,7 +30,7 @@
"mine": null
},
"0,6": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": null
},
"0,7": {
@ -38,14 +38,14 @@
"mine": null
},
"0,8": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "chained",
"predecessor": "0,3"
}
},
"0,9": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "time",
"timer": 20
@ -56,13 +56,13 @@
"mine": null
},
"1,1": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "standard"
}
},
"1,2": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"1,3": {
@ -101,7 +101,7 @@
"mine": null
},
"2,1": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "standard"
}
@ -122,7 +122,7 @@
"mine": null
},
"2,5": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": {
"mine_type": "standard"
}
@ -136,14 +136,14 @@
"mine": null
},
"2,8": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
}
},
"2,9": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"3,0": {
@ -151,7 +151,7 @@
"mine": null
},
"3,1": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": {
"mine_type": "time",
"timer": 19
@ -177,7 +177,7 @@
"mine": null
},
"3,6": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": null
@ -200,7 +200,7 @@
"mine": null
},
"4,1": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": null
},
"4,2": {
@ -218,11 +218,11 @@
"mine": null
},
"4,5": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": null
},
"4,6": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"4,7": {
@ -245,7 +245,7 @@
"mine": null
},
"5,1": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": {
"mine_type": "chained",
"predecessor": "2,3"
@ -275,7 +275,7 @@
"mine": null
},
"5,7": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": null
},
"5,8": {
@ -307,13 +307,13 @@
"mine": null
},
"6,5": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "standard"
}
},
"6,6": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"6,7": {
@ -354,20 +354,20 @@
"mine": null
},
"7,5": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "standard"
}
},
"7,6": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "time",
"timer": 39
}
},
"7,7": {
"terrain": "MUD",
"terrain": "GRASS",
"mine": null
},
"7,8": {
@ -383,7 +383,7 @@
"mine": null
},
"8,1": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": {
"mine_type": "time",
"timer": 24
@ -431,11 +431,11 @@
"mine": null
},
"9,1": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"9,2": {
"terrain": "GRASS",
"terrain": "MUD",
"mine": null
},
"9,3": {